When I start a new activity in a fragment like this
Intent launchIntent = new Intent();
launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
launchIntent.setClassName(getBaseActivity().getPackageName(), MainActivity.class.getName());
startActivity(launchIntent);
getBaseActivity().finish();
a fragment of the old activity which is subscribing the same event I want to to catch in the new activity is called. Do I end the old activity wrong or is the fragment not ended? I unregister in the onDestroy method of every fragment and activity.
@Override
public void onDestroy() {
OttoBus.getInstance().unregister(this);
super.onDestroy();
}