A sequence of events or system calls relevant to the creation, startup, inactivation, resuming, shutdown and destruction (cleanup) of some program or its component (activity, library, servlet). Lifecycles are supported by various programming platforms.
Questions tagged [lifecycle]
2000 questions
21
votes
4 answers
Problems understanding the life cycle when screen goes off and on
Information:
My device is a Nexus One with 2.2 and I have tested two projects, one on 1.5 and one on 2.1.
Problem:
I have trouble to understand the life cycle of my application when the screen is turned off and on.
Here is my output
// activity…

WarrenFaith
- 57,492
- 25
- 134
- 150
20
votes
1 answer
What's the view build time?
I'm pretty new to JSF and reading some of the stack-answers like this one, I faced with the concept of view build time. Consider the JSF lifecycle scheme:
As you can see, there's no phase called view build time. Maybe it means the same as Restore…

stella
- 2,546
- 2
- 18
- 33
20
votes
21 answers
A company that had a successful product but went bust for not innovating?
At the company that I work we have a successful software product that did well but is now obsolete and unmaintainable. I am trying to explain that you need to innovate and replace this product with new offering in order to survive. I am looking for…

Dan
- 11,077
- 20
- 84
- 119
19
votes
3 answers
What methods are invoked in the Activity Lifecycle in the following cases:
Let's say I have a Hello World single Activity application. I start this application.
What methods are invoked in each case:
Home button is pressed: ?
Back button is pressed: ?
Phone call is received: ?
What methods are invoked once the user…

user432209
- 20,007
- 10
- 56
- 75
19
votes
2 answers
When will AWS S3 delete the expired objects?
I have a AWS S3 bucket with a 1 day expiration lifecycle rule. But the AWS didn’t delete the expired objects automatically. How can I let AWS delete the expired objects automatically? Are there still additional cost for these expired but unremoved…

YangChen
- 213
- 1
- 2
- 7
19
votes
2 answers
why we can call getActivity() in onCreateView which run before onActivityCreated?
I really get confused with Fragment lifecycle, especially for the time to call getActivity(). Sometimes you cannot get Activity by getActivity(). And it always caused some puzzling bugs.
Thank you for anyone can solve the puzzle.

CodeAlien
- 766
- 2
- 7
- 15
18
votes
9 answers
Android activity lifecycle: state order when new activity starts
If I launch Activity2 from Activity1 by this way: startActivity(Activity2); what executes first: onStop() (Activity1) or onStart() (Activity2) ?
Do they work simultaneously or in turn? If one after another, what is first?
So in general : what is the…

Ilya Blokh
- 11,923
- 11
- 52
- 84
18
votes
3 answers
Saving Activity State in the onPause
I have a variable that I have successfully saved and restored using onSaveInstanceState
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); // the UI component values are saved here.
…

Waggoner_Keith
- 590
- 2
- 9
- 37
18
votes
1 answer
How to trigger application shutdown from a service in Nest.js?
I'm looking for a way to trigger application shutdown from a service in Nest.js that will still call hooks.
I have a case when I'm handling a message in a service and in some scenario this should shutdown the application. I used to throw unhandled…

superrafal
- 516
- 1
- 3
- 10
18
votes
4 answers
Flutter: Lifecycle of a Widget and Navigation
I have written a flutter plugin, that displays a camera preview and scans for barcodes. I have a Widget called ScanPage that displays the CameraPreview and navigates to a new Route when a barcode is detected.
Problem:
When I push a new Route…

hendra
- 2,531
- 5
- 22
- 34
18
votes
5 answers
UIViewController: viewWillAppear is called, viewDidAppear not
In a UIViewController subclass, I have the following methods:
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// do something
myTextField.text = @"Default";
}
- (void)viewDidAppear:(BOOL)animated {
[super…

Sven Tiffe
- 1,141
- 2
- 8
- 7
18
votes
1 answer
Using Maven to build c++ in eclipse
My Project consists of multiple Java-Projects, one Java-JNI-C++ Project as a Bridge and one pure C++ Project keeping an algorithm library. I managed to write Maven build configurations for all 3 project kinds. So when I'm calling them on the…

Lukas Lentner
- 370
- 3
- 11
18
votes
3 answers
Prevent Android activity from being recreated on turning screen off
How to prevent an activity from being recreated on turning screen off?
What I do
Start Bejewels and go to the jewelry screen.
Press power button shortly. The screen is turned off, but the device is not.
Press power button again.
What I see
The…

noober
- 4,819
- 12
- 49
- 85
17
votes
5 answers
OnRestart vs. OnResume - Android Lifecycle Question
My end-goal is to have an application that runs a block of code when it (the application, not the activity) is opened up after being left ( back from home screen, etc... )
According to the Activity Lifecycle, this should be the onRestart() event on…

jondavidjohn
- 61,812
- 21
- 118
- 158
17
votes
1 answer
Define a destroy-method in annotation-based bean?
I'm looking for a way to tell spring which method on an annotation-based bean it should call when it's destryoing that bean.
What I'm actually trying to achieve is, to be notified when a session-scoped bean is destroyed in order to persist some…

chzbrgla
- 5,158
- 7
- 39
- 56