aspose file tools*
The moose likes Android and the fly likes Passing data among Activities Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Passing data among Activities" Watch "Passing data among Activities" New topic
Author

Passing data among Activities

Jake Reynolds
Greenhorn

Joined: Mar 10, 2009
Posts: 12
I've got an idea for an application, but it's going to end up having a lot of variables that I'd like to stay static, both across application launches and Activities (I can think of at least two that I'd be using). What's the best way to handle this? A single row sqlite db? Writing the variables out to a file? Creating an object to hold them then pass it to the activities, and serialize it on pause?

Thanks,
--Jake


--Jake
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369

android.app.Activityclass has methods called getExtras(..) and putExtras(..) that you can use to pass data around. You can use android.os.Bundle to pass data between activities(it is serializable too).


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Jake Reynolds
Greenhorn

Joined: Mar 10, 2009
Posts: 12
Ohhhh, I saw that put to work in Hello, Android and hadn't even thought of it... Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing data among Activities
 
Similar Threads
Images and icon preferred size
Best practices for storing state data "outside" of the Activity
binding and unbinding and rebinding events in jQuery
Home Button
JMS connection factory