I'm trying to store a value to an array on a button click and then recall it once store in an array.
This is my array code:
public class Favorites extends ListActivity {
static ArrayList<String> ItemArray = new ArrayList<String>();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Full Screen
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.favorites);
}
public void add(String Item) {
ItemArray.add(Item);
}
}
This is the is the code I have in the button click
String Item;
Item=getItem();
Bundle value= new Bundle();
value.putStringArrayList(Item, MyArrayClass.ItemArray);