大佬教程收集整理的这篇文章主要介绍了android – 创建包并发送到新活动,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是它在主要活动中创建的时间
//Create bundle to reference values in next class Bundle bundle = new Bundle(); bundle.puTint("ODD",odd); bundle.puTint("EVEN",even); bundle.puTint("smaLL",small); bundle.puTint("BIG",big); //After all data has been entered and calculated,go to new page for results Intent myIntent = new Intent(); myIntent.setClass(getBaseContext(),Results.class); startActivity(myIntent); //Add the bundlE into myIntent for referencing variables myIntent.putExtras(bundlE);
然后,当我提取其他活动
//Extract the bundle from thE intent to use variables Bundle bundle = geTintent().getExtras(); //Extract each value from the bundle for usage int odd = bundle.geTint("ODD"); int even = bundle.geTint("EVEN"); int big = bundle.geTint("BIG"); int small = bundle.geTint("smaLL");
当我在第二个活动中提取包时应用程序崩溃.
但是当我注释掉束的提取时.该应用运行正常.所以我把它缩小到了那个范围.
我的日志猫并没有真正解释错误是什么,或者我只是不明白它
想法?
以上是大佬教程为你收集整理的android – 创建包并发送到新活动全部内容,希望文章能够帮你解决android – 创建包并发送到新活动所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。