@Override protected void onPostExecute(Boolean result) { super.onPostExecute(result); if (result) { Toast.makeText( getActivity().getApplicationContext(), getString(R.string.adjustments_successful), Toast.LENGTH_LONG) .show(); dismiss(); FragmentActivity activity = getActivity(); if (activity != null) { activity.finish(); startActivity( adjustmentReasonIsPhysicalCount() ? new Intent(context, HomeActivity.class) : activity.getIntent()); } } else { Toast.makeText( getActivity().getApplicationContext(), "Failed to save Adjustments", Toast.LENGTH_LONG) .show(); } dialog.dismiss(); }
public static void removeAllActivities() { for (FragmentActivity activity : activities) { if (!activity.isFinishing()) activity.finish(); activities.remove(activity); } activities.clear(); }
@Override public void finish() { super.finish(); if (shouldFinishRootActivity()) { TiApplication app = getTiApp(); if (app != null) { TiRootActivity rootActivity = app.getRootActivity(); if (rootActivity != null && !(rootActivity.equals(this)) && !rootActivity.isFinishing()) { rootActivity.finish(); } else if (rootActivity == null && !app.isRestartPending()) { // When the root activity has been killed and garbage collected and the app is not // scheduled to restart, // we need to force finish the root activity while this activity has an intent to finish // root. // This happens when the "Don't keep activities" option is enabled and the user stays in // some activity // (eg. heavyweight window, tabgroup) other than the root activity for a while and then he // wants to back // out the app. app.setForceFinishRootActivity(true); } } } }
@Override public void finish() { super.finish(); if (mHasAnimation) { overridePendingTransition(R.anim.slide_left_in, R.anim.slide_right_out); } }
@Override public void finish() { GKIMLog.lf(this, 0, TAG + "=>finish"); if (mFinishData != null) { setResult(RESULT_OK, mFinishData); } super.finish(); }
/** * @internal Intercepts finish calls triggered by activitySetFinishOnTouchOutside by detecting * whether a result has been specified yet. */ @Override public void finish() { if (m_Result == null) { onBackPressed(); } else { super.finish(); } }
@Override public void finish() { clearCachedAuthenticationData(); if (!mAuthWasSuccessful) { BoxAuthentication.getInstance().onAuthenticationFailure(null, null); } super.finish(); }
@Override public void finish() { super.finish(); // Only animate when specified. Should be when it was animated "in" if (mAnimateExit) { overridePendingTransition( R.anim.activity_slide_in_right, R.anim.activity_slide_out_right_full); } }
public static void removeSingleActivity(FragmentActivity fragmentActivity) { fragmentActivity.finish(); for (FragmentActivity activity : activities) { if (activities.contains(fragmentActivity)) { LogTools.w("finishedActivity:" + activity.getClass().getSimpleName()); activities.remove(activity); break; } } }
/** Sends the result or a Constants.ERROR_CODE_CANCELED error if a result isn't present. */ public void finish() { if (mAccountAuthenticatorResponse != null) { // send the result bundle back if set, otherwise send an error. if (mResultBundle != null) { mAccountAuthenticatorResponse.onResult(mResultBundle); } else { mAccountAuthenticatorResponse.onError(AccountManager.ERROR_CODE_CANCELED, "canceled"); } mAccountAuthenticatorResponse = null; } super.finish(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); // Get local Bluetooth adapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); // If the adapter is null, then Bluetooth is not supported if (mBluetoothAdapter == null) { FragmentActivity activity = getActivity(); Toast.makeText(activity, "Bluetooth is not available", Toast.LENGTH_LONG).show(); activity.finish(); } }
/*package*/ void finishFragment() { FragmentActivity activity = getActivity(); if (activity instanceof JRFragmentHostActivity) { if (mFragmentResult != null) ((JRFragmentHostActivity) activity)._setResult(mFragmentResult); activity.finish(); } else if (null != activity) { FragmentManager fm = activity.getSupportFragmentManager(); int bsec = fm.getBackStackEntryCount(); if (bsec > 0 && fm.getBackStackEntryAt(bsec - 1).getName().equals(getLogTag())) { fm.popBackStack(); } else if (bsec > 0) { Log.e(TAG, "Error trying to finish fragment not on top of back stack"); fm.popBackStack(getLogTag(), FragmentManager.POP_BACK_STACK_INCLUSIVE); } else { // bsec == 0 // Root fragment, if it's finishing it's because authentication finished? fm.beginTransaction().remove(this).setTransition(FragmentTransaction.TRANSIT_NONE).commit(); } } }
@Override public void finish() { isdestoryed = true; m_libgdxFgm.preDestory(); super.finish(); }
@Override public void finish() { this.overridePendingTransition(R.anim.push_right_in, R.anim.push_right_out); super.finish(); }
/** * 描述:Activity结束. * * @see android.app.Activity#finish() */ @Override public void finish() { AbActivityManager.getInstance().removeActivity(this); super.finish(); }
private void sendCurrentLocation() { Intent intent = new Intent(context, ChangeCurrentLocationActivity.class); intent.putExtra("isSignedIn", signedIn); context.startActivity(intent); activity.finish(); }
private void finish() { FragmentActivity activity = getActivity(); activity.setResult(Activity.RESULT_OK); activity.finish(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LogUtils.logd(TAG, "[onCreate]: " + getFragmentId()); JRSession session = JRSession.getInstance(); if (session == null || savedInstanceState != null) { /* This flow control path is reached when there's process death and restart */ Log.e(TAG, "bailing out after a process kill/restart. mSession: " + session); // prevent fragment recreation error -- the system needs the fragment's container to exist // even if the Activity is finishing right away setContentView(R.layout.jr_fragment_host_activity); super.finish(); return; } switch (getFragmentId()) { case JR_PROVIDER_LIST: mUiFragment = new JRProviderListFragment(); break; case JR_LANDING: mUiFragment = new JRLandingFragment(); break; case JR_WEBVIEW: mUiFragment = new JRWebViewFragment(); break; case JR_PUBLISH: mUiFragment = new JRPublishFragment(); break; case JR_OPENID_APPAUTH: mUiFragment = new JROpenIDAppAuthFragment(); break; default: throw new IllegalFragmentIdException(getFragmentId()); } Bundle fragArgs = new Bundle(); fragArgs.putInt(JRUiFragment.JR_FRAGMENT_FLOW_MODE, getFlowMode()); fragArgs.putAll(getIntent().getExtras()); mUiFragment.setArguments(fragArgs); mUiFragment.onFragmentHostActivityCreate(this, session); if (shouldBeDialog()) { AndroidUtils.activitySetFinishOnTouchOutside(this, true); if (shouldBePhoneSizedDialog()) { getTheme().applyStyle(R.style.jr_dialog_phone_sized, true); } else { getTheme().applyStyle(R.style.jr_dialog_71_percent, true); } if (!mUiFragment.shouldShowTitleWhenDialog()) { getTheme().applyStyle(R.style.jr_disable_title_and_action_bar_style, true); } } else if (getOperationMode() == JR_FULLSCREEN_NO_TITLE) { getWindow().requestFeature(Window.FEATURE_NO_TITLE); getTheme().applyStyle(R.style.jr_disable_title_and_action_bar_style, true); } else if (getOperationMode() == JR_FULLSCREEN) { // noop } setContentView(R.layout.jr_fragment_host_activity); View fragmentContainer = findViewById(R.id.jr_fragment_container); if (fragmentContainer instanceof CustomMeasuringFrameLayout) { // CMFL -> dialog mode on a tablet if (shouldBePhoneSizedDialog()) { // Do the actual setting of the target size to achieve phone sized dialog. ((CustomMeasuringFrameLayout) fragmentContainer).setTargetSizeDip(320, 480); getWindow().makeActive(); WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(getWindow().getAttributes()); lp.width = AndroidUtils.scaleDipToPixels(320); // After discussing it with Lilli we think it makes sense to let the height of the window // grow if the title is enabled // int targetHeight = mUiFragment.getCustomTitle() == null ? 480 : 560; // lp.height = AndroidUtils.scaleDipToPixels(targetHeight); getWindow().setAttributes(lp); } } getSupportFragmentManager() .beginTransaction() .add(R.id.jr_fragment_container, mUiFragment) .setTransition(FragmentTransaction.TRANSIT_NONE) .commit(); }
@Override public void finish() { super.finish(); this.overridePendingTransition(R.anim.slide_in_from_left, R.anim.slide_out_to_right); }
@Override public void finish() { super.finish(); overridePendingTransition(R.anim.left_in, R.anim.left_out); }
@Override public void finish() { super.finish(); }
public void finishStage() { FragmentActivity activity = getActivity(); if (activity != null) { activity.finish(); } }
@Override public void finish() { super.finish(); this.overridePendingTransition(R.anim.push_stay, R.anim.push_bottom_out); }
/** * Only call this when pressing the up-navigation. Makes sure the new activity comes in on top of * this one. */ void finishSlideTop() { super.finish(); overridePendingTransition(R.anim.activity_slide_in_right_full, R.anim.activity_slide_out_right); }
@Override public void finish() { /** 界面结束时,清除掉记录中对应的KEY */ SystemTool.removeActivity(getActivityKey()); super.finish(); }