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


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,



New! Faster Messenger access on the new MSN homepage 

Other Threads

1. Android Native Heap inspection

Hi all,

I'm having trouble getting the native heap information from my HTC
Magic running Android 2.2.1.
I've configured the standalone DDMS setting "native=true" and used the
- adb shell setprop libc.debug.malloc 1
- adb shell stop
- adb shell start

However, when I go to the native heap tab in the standalone DDMS and
press 'full update', It won't show any heap information. In the log I
can see that there is a message with the tag 'ddm-nativeheap' that
says 'Sending 13738 bytes', followed by a message with the tag
'dalvikvm' that says 'dvmDdmHandleHpsgChunk(when 1, what 1, heap1).

Can someone help me with getting the native heap allocations?


Ove Danner


2. Does VP8 decoder support 720P resolution video playback in Gingerbread 2.3.3 ?


Is 720P resolution support is available in VP8Decoder  in Gingerbread
2.3.3 i.e for WebM file video Playback ?


3. Hello Everyone!

4. Remote Play (PS3) on Xperia Play ?

5. Problems with WebView focus and softkeyboard

6. Camera startPreview() failed on Nexus S with Gingerbread

7. Consume SMS before sms application gets it