【发布时间】:2013-11-21 16:09:46
【问题描述】:
在mActivity.this我设置了一个意图和一个包
Intent intent = new Intent(mActivity.this, nextActivity.class);
Bundle mBundleNow = new Bundle();
mBundleNow.putString("formattedAddress", formattedAddress);
mBundleNow.putDouble("latitude", latitude);
mBundleNow.putDouble("longitude", longitude);
mBundleNow.putString("newRequest", ""); //should probably be bool
intent.putExtras(mBundleNow);
当我运行 startActivity(intent) 时,intent 和 bundle map 被填充。
在nextActivity.class的onCreate方法中,getIntent().getExtras()不为null,但是没有map,我设置的变量都不存在。
这是怎么回事?以及如何正确包含我的意图变量
【问题讨论】:
-
请发布下一个活动的 onCreate() 方法。
标签: android android-intent android-activity bundle oncreate