调用活动时,Bundle map始终为null

时间:2015-12-06 10:18:17

标签: android

我正在尝试使用intent中的extras设置一个bundle对象。但它总是返回null。

活动A: -

Intent connectionIntent = new Intent(DoctorCreateEvent.this, EventsSelectConnectionsActivity.class);
connectionIntent.putExtras(getCreateEventParamBundle());
startActivityForResult(connectionIntent, 123);

private Bundle getCreateEventParamBundle() {
        Bundle paramBundle = new Bundle();
        String startDateTime = Utility.LocalToUTC(mStartDateTextView.getTag() + " " + mEventStartTimeTextView.getTag());
        String endDateTime = Utility.LocalToUTC(mEndDateTextView.getTag() + " " + mEventEndTimeTextView.getTag());
        paramBundle.putString(ServiceConstant.USER_ID, Utility.getSharedPrefStringData(mAct, PrefConstant.USER_ID));
        paramBundle.putString(ServiceConstant.EVENT_NAME, mEventNameTv.getText().toString().trim());
        paramBundle.putString(ServiceConstant.EVENT_DESCRIPTION, mEventDescTv.getText().toString().trim());
        paramBundle.putString(ServiceConstant.EVENT_START_DATE, startDateTime);
        paramBundle.putString(ServiceConstant.EVENT_END_DATE, endDateTime);
        paramBundle.putString(ServiceConstant.EVENT_START_TIME, startDateTime);
        paramBundle.putString(ServiceConstant.EVENT_END_TIME, endDateTime);
        paramBundle.putString(ServiceConstant.EVENT_ADDRESS, mEventAddressTv.getText().toString().trim());
        paramBundle.putString(ServiceConstant.EVENT_COUNTRY, mCountryId + "");
        paramBundle.putString(ServiceConstant.EVENT_STATE, mStateId + "");
        paramBundle.putString(ServiceConstant.EVENT_CITY, mCityId + "");
        paramBundle.putString(ServiceConstant.EVENT_PINCODE, mPinCodeEditText.getText().toString().trim());
        paramBundle.putString(ServiceConstant.EVENT_ISGUEST_FRIEND_ADD_PERMISSION, /*mGuestCanInviteChkBox.isChecked() ? "1" :*/ "0");
        paramBundle.putString(ServiceConstant.EVENT_IS_URGENT_APPROVAL, "0"); // Todo for the time being urgent payment is hidden as discusses with P.M
        paramBundle.putParcelableArrayList(ServiceConstant.EVENT_INVITED_FRIENDS, eventsInvitedFriendsArrayList);
        paramBundle.putString(ServiceConstant.EVENT_ID, "");
        paramBundle.putString(ServiceConstant.EVENT_IS_PUBLISH, AppConstant.EVENT_PUBLISH);
        paramBundle.putSerializable(AppConstant.KEY_CREATE_EVENT_PARAM_IMAGE, getfile());
        return paramBundle;
    }

活动B: -

Bundle bundle = getIntent().getExtras();

在活动A中,当我调试和评估时,我可以看到我的包和我正在设置的数据完美,但是当我在活动B中评估时,地图在包对象中为空。

0 个答案:

没有答案