Basic Android code flow -


lets have 1 main activity called "main", , other sub-activities work , return data. each time main gets called starts sub-activities 1 @ time.

main:

oncreate...{ intent i1 = new intent("com.bla.bla.activity1"); startactivity(i1); //get bundles activity1 , save variables.. intent i2 = new intent("com.bla.bla.activity2"); startactivity(i2); //get bundles activity2 , save variables.. intent i3 = new intent("com.bla.bla.activity3"); startactivity(i2); //get bundles activity1 , save variables.. } 

if understand correctly, activity1 created @ first, , destroyed. code resume , start activity2 or start activity1 again because main activity paused , resumed (assuming don't add onresume/onpause etc..)?

edit:

lets these sub-activities return 1 string each, , each string should saved in 1 individual column of sql entry @ end of main activity. main activity should collect 3 strings, save en entry , destroy itself. work, main activity has resume example @ intent "i2" after intent "i1" has done work , returned string. how result best achieved?

like alex said, wouldn't want that. want use different intents call different activities create flow program. main might lead activity 1, activity 1 leads 2, 3, or 4. if have several activities, can use switch statement determine activity want launch, based on conditions are, or not, met.

hope helps.

edit answer:

if want save variables different activities, want start second activity first, third, second, , on. create data database, can create object, , pass object activity activity, using parcelable interface. within each of activities want use methods save returned data database, see fit.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -