how to pass arraylist as parameter to another screen
Posted
by
user2867267
on Stack Overflow
See other posts from Stack Overflow
or by user2867267
Published on 2013-10-23T09:51:35Z
Indexed on
2013/10/23
9:53 UTC
Read the original article
Hit count: 132
android
how to pass arraylist as parameter to another activity in my condition im not using listview and checkif arraylist contain single element then pass that arrraylist as parameter toanother screen see thisline Category_name.get(position).toString()); how i remove position?? how to passs arraylist parameter toanother activity
static ArrayList<Long> Menu_ID = new ArrayList<Long>();
static ArrayList<String> Category_name = new ArrayList<String>();
JSONArray school = json2.getJSONArray("data");
for (int i = 0; i < school.length(); i++) {
JSONObject object = school.getJSONObject(i);
Category_ID.add((long) i);
Menu_ID.add(Long.parseLong(object.getString("menu_id")));
Category_name.add(object.getString("menu_title"));
}
Intent iMenuList = new Intent(MenuGroup.this, thirdstep.class);
menuidvalue="";
menuidvalue =( Menu_ID.get(position)).toString();
iMenuList.putExtra("Menu_ID",menuidvalue);
iMenuList.putExtra("menu_group",
Category_name.get(position).toString());
startActivity(iMenuList);
© Stack Overflow or respective owner