通过二维数组在Android的一个新活动数组、Android

2023-09-12 23:44:23 作者:ァ陪你到世界的终结

如何通过一个 2D String数组新活动 ???

How to pass a 2d String array to new activity???

,然后在新的活动,我怎么能 检索 的阵列?

and then in new activity, How can i retrieve the array??

推荐答案

您必须使用:

 String [][]str;
 Intent summaryIntent = new Intent(this, Second.class);
 Bundle b=new Bundle();
 b.putSerializable("Array", str);
 summaryIntent.putExtras(b);
 startActivity(summaryIntent);

有关Recieving的阵列中使用:

For Recieving the Array use:

Bundle b = getIntent().getExtras();
String[][] list_array = (String[][])b.getSerializable("Array");

感谢