For example i have activity1, activity2, activity3 and lastly valueAllActivity? how do I pass the data from activity1, activity2, activity3 to --> valueAllActivity?
You have some possibilities.
One that I like more is using the application context...
Create a new class like:
public class DataApp extends Application{
private int myInt;
private MyCustomObject myObj;
public int getMyInt() { return myInt; }
public void setMyInt(int i) { this.myInt = i; }
public MyCustomObject getMyObj() { return myObj; }
public void setMyObj(MyCustomObject ob) { this.myObj = ob;}
}
Add this to you manifest:
...
After, when you need to pass data you can do this in your activity:
DataApp dataInfo = (DataApp)getApplicationContext();
//set some data:
dataInfo.setMyObj(/*put the object*/);
In your other activity, you get you object like this:
DataApp dataInfo = (DataApp)getApplicationContext();
MyCustomObject obj = dataInfo.getMyObj();
With this option, you can pass every object type you want.