转载:http://blog.csdn.net/chjr1000/article/details/49748881
主要通过intent和bundle实现
两个Activity分别命名:
MainActivity和Main2Activity
在MainActivity中,put参数
- int[] wrong = new int[15];
- for(int x = 0;x < 15;x++){
- wrong[x]=x%2;
- }
- Bundle b=new Bundle();
- b.putIntArray("wrong", wrong);
- intent.putExtras(b);
- startActivity(intent);
在Main2Activity中,get参数
- int[] wrong = new int[15];
- Intent intent = getIntent();
- Bundle b=intent.getExtras();
- wrong = b.getIntArray("wrong");
- for(int x=0;x<15;x++){
- Log.i("Main2Activity",""+wrong[x]);//必须一个个的读取
- }
最后
以上就是超级向日葵最近收集整理的关于在两个Activity之间传递IntArray(整形数组)的全部内容,更多相关在两个Activity之间传递IntArray(整形数组)内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复