List of usage examples for android.app Activity finish
public void finish()
From source file:com.ubuntuone.android.files.fragment.SignInFragment.java
@Override public void onSuccess() { mTracker.trackEvent("Referrer", Analytics.REFERRER, "login", 1); mTracker.trackEvent("Referee", Analytics.REFERRER, "login", 1); final Activity activity = getActivity(); activity.setResult(Activity.RESULT_OK); activity.finish(); }
From source file:com.filemanager.free.activities.Preferences.java
@Override public void onBackPressed() { if (select == 1 && changed == 1) restartPC(this); else if (select == 1 || select == 2) { selectItem(0);/*from w w w. j a v a2s .c om*/ } else { Intent in = new Intent(Preferences.this, MainActivity.class); in.setAction(Intent.ACTION_MAIN); final int enter_anim = android.R.anim.fade_in; final int exit_anim = android.R.anim.fade_out; Activity activity = this; activity.overridePendingTransition(enter_anim, exit_anim); activity.finish(); activity.overridePendingTransition(enter_anim, exit_anim); activity.startActivity(in); } MainActivity.showInterstitial(); }
From source file:org.sufficientlysecure.keychain.ui.CertifyKeyFragment.java
@Override public void onQueuedOperationSuccess(CertifyResult result) { // protected by Queueing*Fragment Activity activity = getActivity(); Intent intent = new Intent(); intent.putExtra(CertifyResult.EXTRA_RESULT, result); activity.setResult(Activity.RESULT_OK, intent); activity.finish(); }
From source file:com.facebook.share.internal.DeviceShareDialogFragment.java
private void finishActivity(int resultCode, Intent data) { DeviceRequestsHelper.cleanUpAdvertisementService(currentRequestState.getUserCode()); if (isAdded()) { Activity activity = getActivity(); activity.setResult(resultCode, data); activity.finish(); }/* ww w . ja v a2 s. c om*/ }
From source file:com.filemanager.free.activities.Preferences.java
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: // Navigate "up" the demo structure to the launchpad activity. if (select == 1 && changed == 1) restartPC(this); else if (select == 1) { selectItem(0);//from ww w .j ava 2 s .co m } else { Intent in = new Intent(Preferences.this, MainActivity.class); in.setAction(Intent.ACTION_MAIN); final int enter_anim = android.R.anim.fade_in; final int exit_anim = android.R.anim.fade_out; Activity activity = this; activity.overridePendingTransition(enter_anim, exit_anim); activity.finish(); activity.overridePendingTransition(enter_anim, exit_anim); activity.startActivity(in); } MainActivity.showInterstitial(); return true; } return true; }
From source file:com.hemou.android.account.AccountUtils.java
/** * Update account/*from w w w .j av a 2s . c om*/ * * @param account * @param act * @return true if account was updated, false otherwise */ public static boolean updateAccount(final Account account, final Activity act) { if (act == null) throw new IllegalArgumentException("Activity cannot be null"); final String SUB_TAG = "acnt_update"; int count = UPDATE_COUNT.get(); synchronized (UPDATE_COUNT) { // Don't update the account if the account was successfully updated // while the lock was being waited for if (count != UPDATE_COUNT.get()) return true; AccountManager manager = AccountManager.get(act); try { if (!hasAuthenticator(manager)) throw new AuthenticatorConflictException(); manager.updateCredentials(account, AUTHTOKEN_TYPE, null, act, null, null).getResult(); UPDATE_COUNT.incrementAndGet(); return true; } catch (OperationCanceledException e) { Log.d(SUB_TAG, "Excepting retrieving account", e); act.finish(); return false; } catch (AccountsException e) { Log.d(SUB_TAG, "Excepting retrieving account", e); return false; } catch (AuthenticatorConflictException e) { act.runOnUiThread(new Runnable() { public void run() { showConflictMessage(act); } }); return false; } catch (IOException e) { Log.d(SUB_TAG, "Excepting retrieving account", e); return false; } } }
From source file:com.hufeiya.SignIn.fragment.SignInFragment.java
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { assurePlayerInit();//from w ww . java 2 s. com checkIsInEditMode(); if (null == mUser || edit) { view.findViewById(R.id.empty).setVisibility(View.GONE); view.findViewById(R.id.content).setVisibility(View.VISIBLE); initContentViews(view); initContents(); } else { final Activity activity = getActivity(); CategorySelectionActivity.start(activity, mUser); activity.finish(); } super.onViewCreated(view, savedInstanceState); }
From source file:com.brettyin.cardshelper.fragment.SignInFragment.java
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { playerActivity = (PlayerActivity) getActivity(); assurePlayerInit();/*from ww w.ja v a 2 s . com*/ checkIsInEditMode(); if (null == mPlayer || edit) { view.findViewById(R.id.empty).setVisibility(View.GONE); view.findViewById(R.id.content).setVisibility(View.VISIBLE); initContentViews(view); initContents(); } else { final Activity activity = getActivity(); //CategorySelectionActivity.start(activity, mPlayer); activity.finish(); } super.onViewCreated(view, savedInstanceState); }
From source file:io.imoji.sdk.editor.fragment.OutlineTaskFragment.java
private void notifySuccess(String token, Activity a) { EditorBitmapCache.getInstance().clearNonOutlinedBitmaps(); Intent intent = new Intent(); intent.putExtra(ImojiEditorActivity.CREATE_TOKEN_BUNDLE_ARG_KEY, token); a.setResult(Activity.RESULT_OK, intent); a.finish(); }
From source file:org.androidsoft.app.permission.ui.ApplicationsListFragment.java
/** * {@inheritDoc }/*from ww w . jav a 2s . c o m*/ */ @Override public void onAttach(Activity activity) { super.onAttach(activity); try { // check that the containing activity implements our callback mContainerCallback = (AppListEventsCallback) activity; mActivity = activity; } catch (ClassCastException e) { activity.finish(); throw new ClassCastException(activity.toString() + " must implement AppListEventsCallback"); } }