Android Question Activity

Espinosa4

Active Member
Licensed User
Longtime User
Hello everybody!

I am programming my first app and I've a lot of problems with the activity life cycle.
Reading the Beginners document and here, I think that I can understand the proccess but it's no true. For this reason I'd like to expose my problem and some questions using my poor english, sorry.

Firstly, I open some activities and I use the activity.finish only when the activity read the "back button" key. When I open the third activity I open a picture using TouchImageView. During a laboral journey, I'm always sending the app from foreground to background and viceversa. In Pause procedure, I save in a table the image name and other things to be reload when the activity is load again. but the app raise and exception.

https://www.dropbox.com/s/o6spkpchajxssn9/IMG_20130614_184341.JPG
https://www.dropbox.com/s/dzox722294kwvvb/IMG-20130807-WA0000.jpg


After update to Basic4android 2.71 is very usual that when I back from background to foreground (from third activity) appears the first activity (main) and closing the app using the back button key, the system is showing the third activity. Yes, after close the app.

Ok, here the questions?

- When you open some activities, can Android close all the activities after press the home button? If it is true, I understand that when you back to your app the system is showing the main activity.

- How is the good procedure to work with the activities?

- The variables created in the proccess_globals can be destroyed by android in pause procedure?

Thank you very very much in deed in advance.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Ok, here the questions?

- When you open some activities, can Android close all the activities after press the home button? If it is true, I understand that when you back to your app the system is showing the main activity.

- How is the good procedure to work with the activities?

- The variables created in the proccess_globals can be destroyed by android in pause procedure?
- Yes it is possible if the OS runs low on memory.
- Make each activity independent
- No. They are destroyed when the process is killed when the OS runs low on memory. It is possible the:
- Activity is paused, but in memory, process globals are also in memory
- Activity is killed, but process globals is still in memory
- Process is killed, so no process globals in memory​
 
Upvote 0

Espinosa4

Active Member
Licensed User
Longtime User
Thank you very very much indeed thedesolatesoul! Your post is very useful for me!

Cheers
Espinosa4
 
Upvote 0
Top