I am attempting to build an Android application that has two tabs, one for a textField/button and TreeMenu (where each element has a checkbox associated with it) and another for
As John said, when you want to access data in several activities, just create a class that extends Application:
import android.app.Application;
/**
* Application class used to share data between activities.
* @author Longeanie Christophe
*
*/
public class MyApplication extends Application {
//Put your class members here
@Override
public void onCreate() {
//initialize what's needed here
}
//Getters and setters...
}
In all your activities, you can access this class and its data through this instruction:
MyApplication myApp = (MyApplication) getApplication();