really easy question... but not for me =P

by Kofa » Wed, 03 Mar 2010 06:21:55 GMT

Sponsored Links
 I'm trying to read a variable from one activity to another... i
explain better: I'm making a video game, so the user will have to
chose like a team, color, and other options from one activity and then
should read this variables from another activity.
so the question is... how can i declare integer, string, etc values
from one activity and then read it from another activity? thx a lot


really easy question... but not for me =P

by Ozymandias » Wed, 03 Mar 2010 06:33:44 GMT

 So are you talking about like a Setup activity, where you choose those
things, and then when you're done it launches the game?

If that's what you're talking about, you would create the second
activity and pass the config options to it at creation. 


Sponsored Links

really easy question... but not for me =P

by Vladimir » Wed, 03 Mar 2010 17:31:59 GMT

 Use intent.putExtra(key, value) in your 1st activity and access them
using getIntent().getExtras() in the 2nd


really easy question... but not for me =P

by SREEHARI » Wed, 03 Mar 2010 18:05:13 GMT

 U can use bundle also in passing that variable values.....
In 1st activity
    Bundle bundle = new Bundle();
    bundle.putString(aram1 est;

    Intent newIntent = new Intent(this.getApplicationContext(),

In ActivityClass2, we can read this parameter using

    Bundle bundle = this.getIntent().getExtras();
    String param1 = bundle.getString(aram1;


Other Threads

1. About android linux kernel


I use "repo sync" to get the source from the server, however,  i
didn't see the any linux kernel directory listed there. Why? But I can
see kernel/common.git listed. So when I do "repo sync", it is not
downloading all the sources, right?




2. Problem with turning off GPS updates when application goes into the background.

Hi I'm having a problem when trying to stop location updates when the
app goes into the background. In my onCreate() method I start request
updates like this:

                LocationManager locationManager =


Then in my onPause() and onDestroy() methods I request to stop the
updates like this:

                LocationManager locationManager =

However the GPS icon remains in the status bar and the only way to get
rid of it is to manually kill the application. Am I doing anything



3. Return to my application when back key is pressed from native dialer

4. LVL "LICENSED" Test Respone

5. Warez site ripping off paid apps

6. Dealing with Contacts in Android 2.1 (Deleted Contacts)

7. SmsMessage.getSubmitPdu, 3GPP TS 23.038 V9.0.0 and wrong TP-Data-Coding-Scheme??