0
我想通过startActivityForResult的帮助将数据从我的适配器类传递到另一个片段。如果我使用下面的代码同样的活动重新创建它,我不希望这样。如何解决这个问题?使用startActivityForResult在同一活动中将数据从适配器传递到片段
Bundle mBundle = new Bundle();
mBundle.putString(Constants.SELECTED_PLOCATION, pLocation);
mBundle.putString(Constants.SELECTED_RLOCATION, rLocation);
mBundle.putString(Constants.SELECTED_FROM, selectedFrom);
mBundle.putString(Constants.FROM_TYPE, fromType);
mBundle.putString(Constants.AREA_TYPE, Constants.AREA);
getActivity().getFragmentManager().popBackStackImmediate();
Intent mIntent = new Intent(getActivity(), AuthorizedCustomerActivity.class);
getActivity().startActivityForResult(mIntent, PICK_LOCATION_REQUEST, mBundle);
请指出您的Adapter类和Fragment在哪里?活动片段存在于哪个活动适配器中 –