我如何将 2 个教派数组对象作为参数传递给另一个 Activity
如何在另一个 Activity 中获取二维数组字符串值
String [][]str;
Intent l = new Intent(context,AgAppMenu.class);
l.putExtra("msg",str);
l.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(l);
another Activity class
String[][] xmlRespone2;
xmlRespone2 = getIntent().getExtras().getString("msg");
最佳答案
您可以使用 putSerializable.数组是可序列化的。
存储:
bundle.putSerializable("list", selected_list);
//这里的 bundle 是 Bundle 对象。
访问:
String[][] passedString_list = (String[][]) bundle.getSerializable("list");
例子
Intent mIntent = new Intent(this, Example.class);
Bundle mBundle = new Bundle();
mBundle.putSerializable("list", selected_list);
mIntent.putExtras(mBundle);
关于android - 将二维数组传递给另一个 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12214847/