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.
 http://developer.android.com/intl/zh-CN/reference/android/app/Activity.html 




--


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(),
ActivityClass2.class);
    newIntent.putExtras(bundle);
    startActivity(newIntent);

In ActivityClass2, we can read this parameter using

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





--



Other Threads

1. problem with selcting a item from list

hey all..........i m having problem with selecting a item from a
list....onListItemClic() is not catching this event....is there any other
call back function for this?

-- 
Jayesh M. Jethva

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

2. image to text conversion

I have some camera shots which contains mainly text. I want to convert
them to a string format.

Can anybody suggest a solution for it? Is there any external library
available for android?

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

3. Can anyone make an android app for our web application ?

4. Saving Reading Webview

5. Blue Screen of Death when debugging againstactual phone

6. RSS Normalizing Crashes App

7. Serialization of WebView Object