what is the best practices to keep data between activities deathes/restarts for the whole application session?

by Arhimed » Sat, 09 Jan 2010 03:27:44 GMT


Sponsored Links
 We're designing an app that has several activities which are working
in a wizard like way - user should pass from the activity #1 to
activity #5 to get to the final activity (#6).

Since we know an activity can be suddenly terminated by OS on low
memory we used Application class as a static storage for keeping the
data the user inputs on "wizard" activities and other data our app
needs for the whole session.

Unfortunately we've discovered this approach fails - looks like the
Application class instance is also can be killed by OS (this was
specifically discovered on Android 1.6 versus 1.5). Are our
expectations wrong on this approach (we think Application class
instance always lives for the whole app session)?

So the question is - what is the best practices to keep data between
activities deathes/restarts for the whole application session?



Other Threads

1. OutofMemoryError: bitmap size exceeds VM budget.....

Hi,

I am doing the following in my app, which at times results in the
above error.

Action 1: Button on Main activity calls all pictures using ACTION_PICK
(results in a thumbnail view of all pictures on my phone). User picked
image (URI) is then passed over to next activity where the image is
displayed (ImageView) full screen. When I hit back, I go back to the
main activity. If I try to open all pictures and pick a picture again,
I get a FORCE CLOSE and the logCat data says "OutofMemoryError: bitmap
size exceeds VM budget.

Action 2: I get the same error and FORCE CLOSE when I try to rotate
the full-sized picture by changing phone orientation back and forth.

What am I supposed to do to save memory? I can't change the use case
of my app... the user has to follow the above steps. How can I free up
memory without having to change anything in my app.

Thanks,

Abhi

-- 

2. CM4.2.8.1 suka reboot

As subject, sdh jalan 2hari ini gw pake rom cm 4.2.8.1 dan sdh 4 kali magic
reboot sendiri,
ini kejadian waktu gw coba turn-on mobile netwotk melalui toggle switch,
pernah juga setelah mobile netwotk nyala trs buka browser eh reboot...
Ada yg mengalami hal serupa?

lagi coba CM 4.2.8.1

-- 
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

3. /dev files

4. POST attempts fail every other try?

5. OpenGL: How to test for VBO support?

6. kamus indonesia offline

7. Unable to start an activity, load the home screen, or show a notification during calls on Droid