在Android中将多维字符串数组传递到新活动

3

我想将一个二维字符串数组传递到新的活动中。我看了很多答案但都不理解,您能告诉我怎么做吗?

1个回答

2

使用

Intent mIntent = new Intent(this, Example.class);
Bundle mBundle = new Bundle();
mBundle.putSerializable("list", selected_list);
mIntent.putExtras(mBundle);

获取传递的数组,请使用:
String[][] passedString_list = (String[][]) bundle.getSerializable("list");

什么是Bundle???Bundle bundle??? - Ahmad Abbasi

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接