tags:

views:

85

answers:

3

Hi all,

Been a newbie , to anroid development, i am getting some glitches while making a tab enabled application.

I want to share data, between two tabs of mine application.

How can i achieve the same

Rgds Robert

+1  A: 

You need to use intents to different activities, or in that case of tabs.

Go to Android Common Tasks

And look at the subject below "some intent examples". This will get you started.

You basically need to put whatever values you want into a bundle and pass that over to the new activity using intent.putextras();

Cameron
very diferent to share data between activities defined into tabs.
Jorgesys
A: 

the correct way is setting a static field into the activity that creates the tabs

 public class greformanews extends TabActivity {

       public static String JorgesysTitle;
...
...
...

so in your Activity defined in tab 1

 @Override
 protected void onPause() { 
    greformanews.JorgesysTitle = "JORGESYS =)";
 super.onPause();
}

in your Activity defined in tab 2

//get  value defined in Activity 1 !:)
String Title =  greformanews.JorgesysTitle
Jorgesys
A: 

another response sharing an ArrayList between tabs.

http://stackoverflow.com/questions/2979778/passing-arrayliststring-between-tabs

Jorgesys