通过二维数组在Android的一个新活动 [英] passing 2d array to a new activity in android

查看:107
本文介绍了通过二维数组在Android的一个新活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过一个 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");

感谢

这篇关于通过二维数组在Android的一个新活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆