Well, you can create a Constant class and declare ArrayList as a static variable.
1.)
Class ConstantCodes{ public static ArrayList<MyClass> list = new ArrayList<MyClass>; }
It will be available wherever you want, just ConstantCodes.list
2.) You can extend the class to the Application class, like this
class Globalclass extends Application { private String myState; public String getState(){ return myState; } public void setState(String s){ myState = s; } } class TempActivity extends Activity { @Override public void onCreate(Bundle b){ ... MyApp appState = ((MyApp)getApplicationContext()); String state = appState.getState(); ... } }
source share