I am trying to pass an arrayList to another activity using intents. Here is the code in the first activity.
case R.id.editButton:
Toast.makeText(this, "edit was clicked", Toast.LENGTH_LONG).show();
Intent intent = new Intent(this, editList.class);
intent.putStringArrayListExtra("stock_list", stock_list);
startActivity(intent);
break;
This is where I try to retrieve the list in the second activity. Is something wrong here?
Intent i = new Intent(); //This should be getIntent();
stock_list = new ArrayList<String>();
stock_list = i.getStringArrayListExtra("stock_list");
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…