【发布时间】:2012-10-23 12:00:56
【问题描述】:
我想将一个 ArrayList 从一个活动传递到另一个活动。 我发现这个pass arraylist from one activity to other 的链接很有用。
但是当我使用时
ArrayList<String> hyperlinks = new ArrayList<String>();
...
Intent myIntent=new Intent(Player.this,VideoActivity.class);
Bundle mBundle = new Bundle();
mBundle.putStringArrayListExtra("hyperlinks", hyperlinks);
//mBundle.putString("filePath", hyperlinks.get(0));
myIntent.putExtras(mBundle);
Player.this.startActivity(myIntent);
然后我在 mBundle.putStringArrayListExtra 处遇到错误, 说 方法 putStringArrayListExtra(String, ArrayList) 对于类型 Bundle 是未定义的
请指导我如何做到这一点?
谢谢
【问题讨论】:
-
请阅读 Bundle 和 Intent 文档
标签: android android-intent arraylist