navigating the interface

Put your problem here if it does not fit any of the other categories.

navigating the interface

Postby chippie2000 » Tue Nov 03, 2009 10:15 am

Hey guys,

A very simple question relating to intents. I've got a menu... On the same screen theres a selection box thingy. The user selects what they want... this creates an arrayList of objects. Now when the user selects next... I launch a new intent to display a different GUI to the user... Thats great! But how do I

a) Pass variables...
b) Implement a back button which keeps the selected items checked. At the moment it seems to spawn a new copy of the interface.

I hope that makes sense
chippie2000
Junior Developer
Junior Developer
 
Posts: 22
Joined: Wed Oct 07, 2009 4:11 pm

Top

Postby wiederke » Tue Nov 03, 2009 1:32 pm

Hi,

you can use startActivityForResult and put extra info into the intent to pass values. If your variables are serializables Object you can put them directly into the intent.

You don't need to implement something special about the back button. It just calls finish on your current activity. Thus the activity below your current activity in the activity stack will be show.


cu,

Torsten
wiederke
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Mon Mar 02, 2009 6:46 pm
Location: Germany

Postby qlimax » Tue Nov 03, 2009 1:38 pm

hi, to pass variables take a look at the putExtra() and get***Extra() of the Intent...
in the started activity you can do getIntent() to retrive the intent (and then get***Extra()).

to keep selected values i think you just don't have to finish the menu activity, when you start the next intent.
then to implement a back button, just call the finish() function in the button's clicklistener, this will bring you back to the (non finished) menu activity.

hope it helps :?
¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 12 guests