public static String onCreate(Bundle savedInstanceState, Object activity) { String tag = savedInstanceState != null ? savedInstanceState.getString(SAVE_STATE_KEY_TAG, String.valueOf(activity.hashCode())) : String.valueOf(activity.hashCode()); ResultData data = savedInstanceStateMap.containsKey(tag) ? savedInstanceStateMap.get(tag) : new ResultData(); data.setHasSaveSate(false); savedInstanceStateMap.put(tag, data); return tag; }
public static void onActivityResult(String tag, int requestCode, int resultCode, Bundle data) { final ResultData resultData = savedInstanceStateMap.get(tag); if (resultData != null) resultData.getOnResultSubject().onNext(Tuple3.of(requestCode, resultCode, data)); }