How to pass a variable to a new activity via intent ?

by Emre A. Yavuz » Thu, 17 Sep 2009 06:43:54 GMT


Sponsored Links
 Hi,

 

I'd like to pass a variable to a new activity which I start using an Intent. I 
know that I need to use the putExtra() method on the intent which I create in 
the old Activity. I also know that I need to use the getIntExtra() method 
(assuming that the variable I am trying to pass is an Integer) to grab it in 
the new Activity.

 

Here comes the problem;

 

I have to call the method getIntExtra() on an Intent in the new Activity, yet I 
am not sure what that Intent would be. How can I get a hold of the Intent which 
I created in the old Activity ? Any suggestions ?

 

Thanks in advance,

 

With regards,

 

Emre

_________________________________________________________________
New! Faster Messenger access on the new MSN homepage
 http://go.microsoft.com/?linkid=9677406 
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Writing Lat/Long to Camera EXIF

Hello everyone.  I'm trying to write an application that places a
latitude and longitude stamp on all pictures.  I can see in the LogCat
output that there is someway of altering the EXIF headers in this
way.  How exactly can this be done?  Thanks in advance.


06-01 01:07:04.877: VERBOSE/QualcommCameraHardware(35):
receiveRawPicture: GPS PARM gps-timestamp --> [(null)]
06-01 01:07:04.877: WARN/QualcommCameraHardware(35):
receiveRawPicture: GPS timestamp not specified: defaulting to zero in
EXIF header.
06-01 01:07:04.877: VERBOSE/QualcommCameraHardware(35):
receiveRawPicture: GPS PARM gps-altitude --> [(null)]
06-01 01:07:04.877: WARN/QualcommCameraHardware(35):
receiveRawPicture: GPS altitude not specified: defaulting to zero in
EXIF header.
06-01 01:07:04.877: VERBOSE/QualcommCameraHardware(35):
receiveRawPicture: GPS PARM gps-latitude --> [(null)]
06-01 01:07:04.877: WARN/QualcommCameraHardware(35):
receiveRawPicture: GPS latitude not specified: defaulting to zero in
EXIF header.
06-01 01:07:04.877: VERBOSE/QualcommCameraHardware(35):
receiveRawPicture: GPS PARM gps-longitude --> [(null)]
06-01 01:07:04.877: WARN/QualcommCameraHardware(35):
receiveRawPicture: GPS longitude not specified: defaulting to zero in
EXIF header.

--~--~---------~--~----~------------~-------~--~----~

2. How to type in different language on emulator 1.1 and 1.5?

I want test my app in different language. Currently I am able to
change the language of the emulator 1.5 and my app starts showing
strings for that language but when i type in the edit box it still
shows english. Do I have to change some code so that my edit box n
everything else supports multiple language? Or do i have to tweak the
emulator so that it starts typing in language other than enlish?
--~--~---------~--~----~------------~-------~--~----~

3. Will android-challenge mailing list open?

4. Can't figure out how to use SurfaceView properly, nothing is drawn

5. Adding items to a ListView

6. How to Enable network support for emulator (Android 1.5)

7. How to let Android create my activity within the process which the launcher activity lies in?