Two Laptop Bag
The moose likes Android and the fly likes Send variable value from one activity to another Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "Send variable value from one activity to another" Watch "Send variable value from one activity to another" New topic
Author

Send variable value from one activity to another

Marios Trypas
Greenhorn

Joined: Jan 20, 2011
Posts: 2
I'm having the following code to take a picture using AVD and another activity that shows on screen the battery level

(remember code tags)

What I need is a suggestion about how can i control variable bLevel in "Snapshot". I want to change the code to control the compression. To make it clear I want something like that


Thanks in advance
David Freitag
Greenhorn

Joined: May 28, 2011
Posts: 13

Well, the only way i know of how to pass information between activities is using a Bundle.
But that involves directly starting an Intent, and im not sure thats what you are looking for but here 'goes.

to pass information into the Activity in question, you use Intent.putExtra();

You will use that PrefixTitle in the TargetActivity to look for the correct information, there are several different data types that can be passed not just Strings as in this example.


Hope that helps..
 
 
subject: Send variable value from one activity to another
 
Threads others viewed
Null pointer exception probably due to synchronisation issues; problem in starting activity
Can I use this code to take a photo and display it?
Android forces application to be closed
Interactive Stories on Android
Not able to write the image to file
developer file tools