Questions tagged [lifecycle]

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.

2000 questions
36
votes
2 answers

How can i remove a singleton spring bean from ApplicationContext?

I want to develop a module control system so that every spring bean can be managed by my own LifeCycle Controller. But I can not figure out how can I remove a singleton spring bean out of ApplicationContext. That may be an interesting problem , can…
jackalope
  • 1,554
  • 3
  • 17
  • 37
35
votes
4 answers

Which VueJS lifecycle hook must Asynchronous HTTP requests be called in?

I'd like to know how before I render a page, I want to send an async GET request to my server to retrieve data and populate the properties in data. I heard the best way to do this is to call the function that sends this request in one of the three…
Baalateja Kataru
  • 851
  • 2
  • 11
  • 11
33
votes
2 answers

Android Activity lifecycle and locking/unlocking device

I just found that when the device has lock screen enabled, the followings happen. For this activity, android:screenOrientation="landscape" is set in the manifest. Then I perform the followings with my phone in a portrait mode. The user opens an…
user2062024
  • 3,541
  • 7
  • 33
  • 44
31
votes
1 answer

What is the lifecycle and concurrency semantics of Rhino Script Engine

I am interested in the lifecycle and concurrency semantics of (Rhino) Script Engine and associated classes. Specifically: Is Bindings supposed to be thread safe? Should multiple threads be allowed to share a single ScriptEngine instance? ... or…
Dilum Ranatunga
  • 13,254
  • 3
  • 41
  • 52
31
votes
4 answers

onCreateView method gets called when? and How many times in Activity life cycle?

I wrote a little program looking like this: package com.example.lifecycle; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.util.AttributeSet; import android.util.Log; import…
user3728910
  • 313
  • 1
  • 3
  • 6
31
votes
8 answers

Is MFC still used for new development (with any material volume)?

I've never been a big fan of MFC, but that's not really the point. I read that Microsoft is due to release a new version of MFC in 2010 and it really struck me as odd - I thought MFC was dead (no ill intention, I really did). Is is MFC used for new…
NTDLS
  • 4,757
  • 4
  • 44
  • 70
30
votes
1 answer

onStart of new Activity is called before onStop of parent

I've got an application. I use startActivity() to start activity. Can anyone actually tell me why system is calling onStart() of new Activity first, instead of parents onStop()? Is that even possible (without system bug)? I've found Fragment…
cadavre
  • 1,334
  • 1
  • 18
  • 34
30
votes
1 answer

If I run mvn deploy does it build new artifacts or it just deploy the already existing artifacts in to the remote server?

Note: This question has been originally posted by Lahiru Gunathilake as an answer to another question. I'm moving it here as a separated question for the sake of clarity. When we are doing a release we just build in our local machine and do the QA…
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
29
votes
7 answers

android finish() method doesn't clear app from memory

I have an activity and I call the finish() method and the activity is not cleared from memory. After calling finish() , I see that the method onDestroy() is executed successfully (and I clear all my variables and stuff in there). Should it be…
Daniel Benedykt
  • 6,496
  • 12
  • 51
  • 73
29
votes
3 answers

View controller lifecycle when swiping-to-pop from UINavigationController in iOS7

What is the impact of iOS 7's new swipe-to-pop gesture on the view controller lifecycle of UINavigationController?
23
votes
7 answers

How to check if my activity is the current activity running in the screen

I used Toast to make notification, but it seems it will appear even its activity is not in the current screen and some other activity has been started. I want to check this situation, when the activity is not the current one, I'd not send the Toast…
virsir
  • 15,159
  • 25
  • 75
  • 109
22
votes
3 answers

Unexpected resume of "package name" while already resumed in ''package name" Error in Android

If changing the orientation of my phone or the emulator I get the following output in LogCat: 04-09 11:55:26.290: INFO/WindowManager(52): Setting rotation to 1, animFlags=0 04-09 11:55:26.300: INFO/ActivityManager(52): Config changed: { scale=1.0…
Janusz
  • 187,060
  • 113
  • 301
  • 369
22
votes
2 answers

How do I preserve a complex object across Activity restarts?

Say I have a Java Bean object which is serializable. I want to store it away safely when an Activity goes through onDestroy() on purpose (i.e. onSaveInstanceState() is not called). I am looking for a way which doesn't involve creating a database and…
mxk
  • 43,056
  • 28
  • 105
  • 132
21
votes
9 answers

Simplest Android Activity Lifecycle

I noticed that the Android Developers Activity section has been updated since I started my app, but I am still unclear what the simplest Activity Lifecycle is. As far as I can make out: onCreate, onResume and onPause are the essential ones. The…
FrinkTheBrave
  • 3,894
  • 10
  • 46
  • 55
21
votes
3 answers

How do I force a component to unmount when I navigate to a new page in react native?

I want to make sure the lifecycle method ComponentWillUnmount fires when I navigate to a new page. I found this post, but that doesn't seem to mention anything about navigating to a new page. I also found this post but I'm using react-navigation. …
VK1
  • 1,676
  • 4
  • 28
  • 51