0

I am using a tab layout in which i have four part.first part showing the list of all visitors and second part showing the list of operators and third part is chat part and fourth part is controlling window.the image is given below

![the image given below in which you can see four part.from first tab data is passing to all tabs and in first tab i am showing the list that is being updated each after 3 seconds new data is being added to the list.how to pass data from first tab to the rest of tab.]

nikki
  • 3,248
  • 3
  • 24
  • 29

4 Answers4

8

Tab 0

getParent().getIntent().putExtra("key", "value"); 

Tab 1

String value = getParent().getIntent().getStringExtra("key");
dira
  • 30,304
  • 14
  • 54
  • 69
1

Use one static variables to store data and use them one different tabs

koti
  • 3,681
  • 5
  • 34
  • 58
0

You can have 2-3 methods to do so. 1 . Using Shared Preference 2 . Declare Application level class having getter setter method.set in one tab and get in another tab.

Richa
  • 3,165
  • 1
  • 22
  • 26
0

Ya you can pass the data to a single ton class and in one activity and get it back in another activity.

Relsell
  • 771
  • 6
  • 18