【发布时间】:2011-07-19 11:23:12
【问题描述】:
我正在尝试使用意图将 arrayList 传递给另一个活动。这是第一个活动中的代码。
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;
这是我尝试在第二个活动中检索列表的地方。这里有什么问题吗?
Intent i = new Intent(); //This should be getIntent();
stock_list = new ArrayList<String>();
stock_list = i.getStringArrayListExtra("stock_list");
【问题讨论】:
标签: android arraylist android-intent