activity-lifecycle Questions
4
Solved
There are lots of reasons why detecting if application is on foreground.
for example - as a trigger to GCM/C2DM push notification - lot's of apps would have good reason implementing different behav...
Serica asked 26/12, 2012 at 18:20
2
Solved
I would like to use Room with LiveData, and in other projects I already used it, but in this one, I can not get it to work. It can't convert my activity into Lifecycle activity when I try to observ...
Giacomo asked 21/6, 2018 at 20:0
6
I am little confused between the life cycle of two activities.
Suppose I have Activity A and Activity B.
B is called From A i.e A ----> B.
Now currently B is on the screen and I pressed back ...
Degression asked 25/2, 2014 at 10:43
3
onPause() should be used to save persistent data and onSaveInstanceState(Bundle) is typically used to save non-persistent data.What does that mean?What is difference between persistent and non-pers...
Sizing asked 18/2, 2016 at 8:33
1
Solved
I am trying the new Android P Developer Preview, and the secenario is as follows:
I call Activity B from Activity A with startActivityForResult
Finish Activity B with SetResult and go back to A...
Urethroscope asked 22/5, 2018 at 12:16
18
Solved
All activities in my application require a user to be logged-in to view. Users can log out from almost any activity. This is a requirement of the application. At any point if the user logs-out, I w...
Beaufort asked 9/6, 2010 at 16:53
0
I am currently trying to monitor applications being launched and closed under Android. I need to create Android Service app that accumulate statistics (Time, AppName) about starting and terminating...
Helotry asked 9/2, 2018 at 5:46
3
Every time I pause my activity (actually Fragment) to go to another app, upon returning with onResume I try to resume the video playing but it does not play: I get a blank screen. Upon investigatio...
Nittygritty asked 22/10, 2015 at 18:38
8
Android doc say:
"When the system, rather than the user, shuts down an activity to conserve memory, ... "
But how to simulate this situation?I want to debug the onRestoreInstanceState(Bundle) ...
Inventor asked 1/3, 2010 at 12:56
2
Solved
I had an Activity that extended AppCompactActivity, and in onCreate method I setted the Toolbar using setSupportActionBar method in the usual way:
public class StepMasterActivity extends AppCompat...
androidandroid-activityactivity-lifecycleandroid-architecture-componentsandroid-architecture-lifecycle
Waynant asked 20/6, 2017 at 23:10
7
Solved
I would like to test out onSaveInstanceState and onRestoreInstanceState for my app on the emulator.
I have found this, which says that we could simulate this during orientation change, but I'm sto...
Aculeate asked 13/3, 2011 at 3:39
2
I found a few articles talking about how RxJava/RxAndroid can replace event busses (such as otto)
https://lorentzos.com/rxjava-as-event-bus-the-right-way-10a36bdd49ba#.7a4619qva
https://medium.co...
Virgate asked 13/1, 2017 at 20:55
2
Solved
I am a beginner with Android.
In Android, some generic elements can be automatically saved/restored in onSaveInstanceState/onRestoreInstanceState.
For example, an EditText saves/restores the Text...
Agretha asked 25/7, 2017 at 22:3
5
I have set locked orientation
and added the sample code with 2 simple classes like below:
SplashLandscapeActivity.java
public class SplashLandscapeActivity extends AppCompatActivity {
@Override
...
Illtempered asked 22/5, 2017 at 3:14
2
Solved
This is about POST-honeycomb (i.e., Android 3.0+) and the quotes below come from https://developer.android.com/reference/android/app/Activity.html
According to the lifecycle, onStop and onDestroy ...
Wolfhound asked 14/4, 2017 at 13:33
2
Solved
(Yes, I've already looked at existing questions related to this problem.)
I am calling finish() from my Activity's Up button listener. But although onDestroy() does get around to being called, fir...
Dukey asked 2/12, 2016 at 2:57
1
In my Android app I have two activities:
DemoActivity with a button to start the SearchActivity with an Intent
SearchActivity
The button is a custom ViewGroup:
SearchButton
As soon as the S...
Partner asked 6/10, 2016 at 12:45
4
Solved
I have two activities:
Activity A - list of items
Activity B - detail view of an item
Normally, a user opens the app and Activity A is launched. A user sees a list of items, clicks one, and Activ...
Foliation asked 18/8, 2011 at 20:32
1
I am animating a view in an activity after onGlobalLayoutFinished is called on the view. My animation is skipping ~300 ms worth of frames in the beginning. If I delay the animation by more than ~30...
Territory asked 10/2, 2015 at 23:18
2
I am trying to make our video app to support Android N multiwindow mode. I have discovered that activity lifecycle becomes confused in multiwindow mode. The phenomenon is when our app layouts on th...
Alternant asked 28/9, 2016 at 3:54
2
It is unclear (to me, at least) from the documentation whether Activity.onStop is guaranteed to be called. There are two places with seemingly contradictory information.
Javadoc for Activity.onSt...
Mediator asked 1/4, 2015 at 15:43
7
Solved
I have an activity that needs to turn screen on(if offed) when it is started.
So in onCreate, I have:
this.getWindow().setFlags(
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.La...
Foulk asked 18/8, 2014 at 18:37
2
Solved
What method should I use to move my app to background and then move it to foreground again?
I tried using moveTaskToBack(true) and the activity is moved to background successfully but then I can't ...
Phoebephoebus asked 18/3, 2013 at 16:3
1
I have a problem with activity launching in my project.
My 'Home' activity (H) allows to choose some service in it. Lets say S11->...-> S1n is an activity flow for the service (S1). H is the LAUNC...
Sporogonium asked 15/2, 2012 at 9:30
1
I'm at an impasse. I'm using Dagger 2 for dependency injection, but I'm losing state when the app goes into the background. Here is the scenario: the app starts up and creates the dependencies. All...
Recruitment asked 7/11, 2015 at 20:41
© 2022 - 2024 — McMap. All rights reserved.