public static void attachTo( Activity activity, Object executionScope, boolean finishAfterDialog, Bundle argumentsForErrorDialog) { FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager(); SupportManagerFragment fragment = (SupportManagerFragment) fm.findFragmentByTag(TAG_ERROR_DIALOG_MANAGER); if (fragment == null) { fragment = new SupportManagerFragment(); fm.beginTransaction().add(fragment, TAG_ERROR_DIALOG_MANAGER).commit(); fm.executePendingTransactions(); } fragment.finishAfterDialog = finishAfterDialog; fragment.argumentsForErrorDialog = argumentsForErrorDialog; fragment.executionScope = executionScope; }
public static void attachTo( Activity activity, Object executionScope, boolean finishAfterDialog, Bundle argumentsForErrorDialog) { if (factory == null) { throw new RuntimeException( "You must set the static factory field to configure error dialogs for your app."); } if (isSupportActivity(activity)) { SupportManagerFragment.attachTo( activity, executionScope, finishAfterDialog, argumentsForErrorDialog); } else { HoneycombManagerFragment.attachTo( activity, executionScope, finishAfterDialog, argumentsForErrorDialog); } }