List of usage examples for android.content Intent FLAG_ACTIVITY_NO_ANIMATION
int FLAG_ACTIVITY_NO_ANIMATION
To view the source code for android.content Intent FLAG_ACTIVITY_NO_ANIMATION.
Click Source Link
From source file:de.baumann.pdfcreator.about.About_content.java
static MaterialAboutList createMaterialAboutList(final Context c) { MaterialAboutCard.Builder appCardBuilder = new MaterialAboutCard.Builder(); // Add items to card appCardBuilder.addItem(//from w ww .j av a2 s . c o m new MaterialAboutTitleItem.Builder().text(R.string.app_name).icon(R.mipmap.ic_launcher).build()); try { appCardBuilder.addItem(ConvenienceBuilder.createVersionActionItem(c, ContextCompat.getDrawable(c, R.drawable.earth2), "Version", false)); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_changelog) .subText(R.string.about_changelog_summary).icon(R.drawable.format_list_bulleted) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, c.getString(R.string.about_changelog), "https://github.com/scoute-dich/PDFCreator/blob/master/CHANGELOG.md", true, false)) .build()); appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_license) .subText(R.string.about_license_summary).icon(R.drawable.copyright) .setOnClickListener(new MaterialAboutActionItem.OnClickListener() { @Override public void onClick() { final AlertDialog d = new AlertDialog.Builder(c).setTitle(R.string.about_title) .setMessage(helper_main.textSpannable(c.getString(R.string.about_text))) .setPositiveButton(c.getString(R.string.toast_yes), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }) .show(); d.show(); ((TextView) d.findViewById(android.R.id.message)) .setMovementMethod(LinkMovementMethod.getInstance()); } }).build()); appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_intro) .subText(R.string.about_intro_summary).icon(R.drawable.information_outline) .setOnClickListener(new MaterialAboutActionItem.OnClickListener() { @Override public void onClick() { Intent intent = new Intent(c, Activity_intro.class); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); c.startActivity(intent); } }).build()); MaterialAboutCard.Builder authorCardBuilder = new MaterialAboutCard.Builder(); authorCardBuilder.title(R.string.about_title_dev); authorCardBuilder .addItem(new MaterialAboutActionItem.Builder().text(R.string.about_dev) .subText(R.string.about_dev_summary).icon(R.drawable.gaukler_faun) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, c.getString(R.string.about_dev), "https://github.com/scoute-dich/", true, false)) .build()); authorCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_donate) .subText(R.string.about_donate_summary).icon(R.drawable.coin) .setOnClickListener(ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse( "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NP6TGYDYP9SHY"))) .build()); MaterialAboutCard.Builder authorCardBuilder2 = new MaterialAboutCard.Builder(); authorCardBuilder2.title(R.string.about_title_con); authorCardBuilder2.addItem(new MaterialAboutActionItem.Builder().text("Neofaum") .subText(R.string.about_title_con1).icon(R.drawable.github_circle) .setOnClickListener( ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse("https://github.com/naofum"))) .build()); MaterialAboutCard.Builder authorCardBuilder3 = new MaterialAboutCard.Builder(); authorCardBuilder3.title(R.string.about_title_ext); authorCardBuilder3.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_ext) .subText(R.string.about_ext_summary).icon(R.drawable.gaukler_faun) .setOnClickListener(ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse("https://github.com/scoute-dich/MuPDF/releases"))) .build()); MaterialAboutCard.Builder convenienceCardBuilder = new MaterialAboutCard.Builder(); convenienceCardBuilder.title(R.string.about_title_libs); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Android Image Cropper") .subText(R.string.about_license_2).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Android Image Cropper", "https://github.com/ArthurHub/Android-Image-Cropper", true, false)) .build()); convenienceCardBuilder .addItem(new MaterialAboutActionItem.Builder().text("Android Onboarder") .subText(R.string.about_license_3).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Android Onboarder", "https://github.com/chyrta/AndroidOnboarder", true, false)) .build()); convenienceCardBuilder .addItem(new MaterialAboutActionItem.Builder().text("Android PDFView") .subText(R.string.about_license_6).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Android PDFView", "https://github.com/JoanZapata/android-pdfview", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Glide") .subText(R.string.about_license_9).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Glide", "https://github.com/bumptech/glide", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("GPUImage for Android") .subText(R.string.about_license_4).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "GPUImage for Android", "https://github.com/CyberAgent/android-gpuimage", true, false)) .build()); convenienceCardBuilder .addItem( new MaterialAboutActionItem.Builder().text("Image Picker").subText(R.string.about_license_1) .icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Image Picker", "https://github.com/Mariovc/ImagePicker", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("iText") .subText(R.string.about_license_5).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "iText", "https://github.com/itext/itextpdf", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Material About Library") .subText(R.string.about_license_7).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Material About Library", "https://github.com/daniel-stoneuk/material-about-library", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Material Design Icons") .subText(R.string.about_license_8).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Material Design Icons", "https://github.com/Templarian/MaterialDesign", true, false)) .build()); return new MaterialAboutList(appCardBuilder.build(), authorCardBuilder.build(), authorCardBuilder2.build(), authorCardBuilder3.build(), convenienceCardBuilder.build()); }
From source file:com.mycelium.wallet.activity.send.BroadcastTransactionActivity.java
public static void callMe(Activity currentActivity, UUID account, boolean isColdStorage, Transaction signed, String transactionLabel, int requestCode) { Intent intent = new Intent(currentActivity, BroadcastTransactionActivity.class); intent.putExtra("account", account); intent.putExtra("isColdStorage", isColdStorage); intent.putExtra("signed", signed); intent.putExtra("transactionLabel", transactionLabel); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); currentActivity.startActivityForResult(intent, requestCode); }
From source file:com.klinker.android.twitter.activities.drawer_activities.discover.DiscoverPager.java
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); try {/*from w w w.j a v a2 s. c o m*/ mDrawerToggle.onConfigurationChanged(newConfig); } catch (Exception e) { } overridePendingTransition(0, 0); finish(); Intent restart = new Intent(context, DiscoverPager.class); restart.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); overridePendingTransition(0, 0); startActivity(restart); }
From source file:de.baumann.hhsmoodle.about.About_content.java
static MaterialAboutList createMaterialAboutList(final Context c) { MaterialAboutCard.Builder appCardBuilder = new MaterialAboutCard.Builder(); // Add items to card appCardBuilder.addItem(/* ww w .j a va 2 s .co m*/ new MaterialAboutTitleItem.Builder().text(R.string.app_name).icon(R.mipmap.ic_launcher).build()); try { appCardBuilder.addItem(ConvenienceBuilder.createVersionActionItem(c, ContextCompat.getDrawable(c, R.drawable.school), "Version", false)); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_changelog) .subText(R.string.about_changelog_summary).icon(R.drawable.format_list_bulleted) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, c.getString(R.string.about_changelog), "https://github.com/scoute-dich/HHSMoodle/blob/master/CHANGELOG.md", true, false)) .build()); appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_license) .subText(R.string.about_license_summary).icon(R.drawable.copyright) .setOnClickListener(new MaterialAboutActionItem.OnClickListener() { @Override public void onClick() { final AlertDialog d = new AlertDialog.Builder(c).setTitle(R.string.about_title) .setMessage(helper_main.textSpannable(c.getString(R.string.about_text))) .setPositiveButton(c.getString(R.string.toast_yes), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }) .show(); d.show(); ((TextView) d.findViewById(android.R.id.message)) .setMovementMethod(LinkMovementMethod.getInstance()); } }).build()); appCardBuilder.addItem(ConvenienceBuilder.createEmailItem(c, ContextCompat.getDrawable(c, R.drawable.bug), c.getString(R.string.action_problem_summary), true, "juergen.baumann@huebsch.karlsruhe.de", "HHS Moodle")); appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_intro) .subText(R.string.about_intro_summary).icon(R.drawable.information_outline) .setOnClickListener(new MaterialAboutActionItem.OnClickListener() { @Override public void onClick() { Intent intent = new Intent(c, Activity_intro.class); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); c.startActivity(intent); } }).build()); MaterialAboutCard.Builder authorCardBuilder = new MaterialAboutCard.Builder(); authorCardBuilder.title(R.string.about_title_dev); authorCardBuilder .addItem(new MaterialAboutActionItem.Builder().text(R.string.about_dev) .subText(R.string.about_dev_summary).icon(R.drawable.gaukler_faun) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, c.getString(R.string.about_dev), "https://github.com/scoute-dich/", true, false)) .build()); MaterialAboutCard.Builder convenienceCardBuilder = new MaterialAboutCard.Builder(); convenienceCardBuilder.title(R.string.about_title_libs); convenienceCardBuilder .addItem(new MaterialAboutActionItem.Builder().text("Android Onboarder") .subText(R.string.about_license_3).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Android Onboarder", "https://github.com/chyrta/AndroidOnboarder", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Encrypted Userprefs") .subText(R.string.about_license_5).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Encrypted Userprefs", "https://github.com/sveinungkb/encrypted-userprefs", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Glide") .subText(R.string.about_license_9).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Glide", "https://github.com/bumptech/glide", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Material About Library") .subText(R.string.about_license_7).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Material About Library", "https://github.com/daniel-stoneuk/material-about-library", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Material Design Icons") .subText(R.string.about_license_8).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Material Design Icons", "https://github.com/Templarian/MaterialDesign", true, false)) .build()); return new MaterialAboutList(appCardBuilder.build(), authorCardBuilder.build(), convenienceCardBuilder.build()); }
From source file:com.lithidsw.wallbox.app.theme.ThemesMainFragment.java
public void onApplyClicked() { Intent intent = mActivity.getIntent(); intent.putExtra("open_themes_drawer", true); switch (mChoosenTheme) { case DARK_THEME: prefs.edit().putString(C.PREF_THEME, "Dark").commit(); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); mActivity.finish();/*from w w w. j a v a 2s .c o m*/ startActivity(intent); break; case LIGHT_THEME: prefs.edit().putString(C.PREF_THEME, "Light").commit(); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); mActivity.finish(); startActivity(intent); break; case LIGHT_DARKACTIONBAR_THEME: prefs.edit().putString(C.PREF_THEME, "LightDarkActionBar").commit(); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); mActivity.finish(); startActivity(intent); break; } }
From source file:com.liferay.social.activity.MainActivity.java
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: Intent intent = new Intent(this, SettingsActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(intent);//from w w w. j a v a 2 s . c o m return true; default: return false; } }
From source file:mx.itesm.logistics.crew_tracking.activity.LoginActivity.java
protected void launchMainActivity() { Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(intent);// w w w . j a v a 2 s . co m }
From source file:com.android.contacts.activities.RequestPermissionsActivity.java
@Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { if (permissions != null && permissions.length > 0 && isAllGranted(permissions, grantResults)) { mPreviousActivityIntent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); if (mIsCallerSelf) { startActivityForResult(mPreviousActivityIntent, 0); } else {//w w w. j a v a 2 s .c om startActivity(mPreviousActivityIntent); } finish(); overridePendingTransition(0, 0); LocalBroadcastManager.getInstance(this).sendBroadcast(new Intent(BROADCAST_PERMISSIONS_GRANTED)); } else { Toast.makeText(this, R.string.missing_required_permission, Toast.LENGTH_SHORT).show(); finish(); } }
From source file:org.mozilla.focus.notification.BrowsingNotificationService.java
@Override public int onStartCommand(Intent intent, int flags, int startId) { switch (intent.getAction()) { case ACTION_START: startBrowsingSession();//from w w w . j a v a2 s . com break; case ACTION_STOP: stopBrowsingSession(); break; case ACTION_FOREGROUND: foreground = true; break; case ACTION_BACKGROUND: foreground = false; break; case ACTION_ERASE: final Intent activityIntent = new Intent(this, MainActivity.class); activityIntent.setAction(MainActivity.ACTION_ERASE); activityIntent.putExtra(MainActivity.EXTRA_FINISH, !foreground); if (!foreground) { activityIntent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); } // This doesn't seem to be needed on Android 7.1. It is needed on Android 6, or otherwise // we crash with "AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag." activityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(activityIntent); TelemetryWrapper.eraseNotificationEvent(); break; default: throw new IllegalStateException("Unknown intent: " + intent); } return START_NOT_STICKY; }
From source file:de.baumann.quitsmoking.about.About_content.java
static MaterialAboutList createMaterialAboutList(final Context c) { MaterialAboutCard.Builder appCardBuilder = new MaterialAboutCard.Builder(); // Add items to card appCardBuilder.addItem(/*from w w w. j a va2 s. c om*/ new MaterialAboutTitleItem.Builder().text(R.string.app_name).icon(R.mipmap.ic_launcher).build()); try { appCardBuilder.addItem(ConvenienceBuilder.createVersionActionItem(c, ContextCompat.getDrawable(c, R.drawable.earth2), "Version", false)); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } appCardBuilder .addItem(new MaterialAboutActionItem.Builder().text(R.string.about_changelog) .subText(R.string.about_changelog_summary).icon(R.drawable.format_list_bulleted) .setOnClickListener(ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse("https://github.com/scoute-dich/QuitSmoking/blob/master/CHANGELOG.md"))) .build()); appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_license) .subText(R.string.about_license_summary).icon(R.drawable.copyright) .setOnClickListener(new MaterialAboutActionItem.OnClickListener() { @Override public void onClick() { SpannableString s; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { s = new SpannableString( Html.fromHtml(c.getString(R.string.about_text), Html.FROM_HTML_MODE_LEGACY)); } else { //noinspection deprecation s = new SpannableString(Html.fromHtml(c.getString(R.string.about_text))); } Linkify.addLinks(s, Linkify.WEB_URLS); final AlertDialog d = new AlertDialog.Builder(c).setTitle(R.string.about_title) .setMessage(s).setPositiveButton(c.getString(R.string.yes), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }) .show(); d.show(); ((TextView) d.findViewById(android.R.id.message)) .setMovementMethod(LinkMovementMethod.getInstance()); } }).build()); appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_intro) .subText(R.string.about_intro_summary).icon(R.drawable.information_outline_dark) .setOnClickListener(new MaterialAboutActionItem.OnClickListener() { @Override public void onClick() { Intent intent = new Intent(c, Activity_intro.class); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); c.startActivity(intent); } }).build()); MaterialAboutCard.Builder authorCardBuilder = new MaterialAboutCard.Builder(); authorCardBuilder.title(R.string.about_title_dev); authorCardBuilder.addItem( new MaterialAboutActionItem.Builder().text(R.string.about_dev).subText(R.string.about_dev_summary) .icon(R.drawable.gaukler_faun).setOnClickListener(ConvenienceBuilder .createWebsiteOnClickAction(c, Uri.parse("https://github.com/scoute-dich/"))) .build()); authorCardBuilder.addItem(new MaterialAboutActionItem.Builder().text(R.string.about_donate) .subText(R.string.about_donate_summary).icon(R.drawable.coin) .setOnClickListener(ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse( "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NP6TGYDYP9SHY"))) .build()); MaterialAboutCard.Builder authorCardBuilder2 = new MaterialAboutCard.Builder(); authorCardBuilder2.title(R.string.about_title_ext); authorCardBuilder2.addItem(new MaterialAboutActionItem.Builder().text("Neofaum") .subText(R.string.about_title_ext3).icon(R.drawable.github_circle) .setOnClickListener( ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse("https://github.com/naofum"))) .build()); authorCardBuilder2.addItem(new MaterialAboutActionItem.Builder().text("Primokorn") .subText(R.string.about_title_ext4).icon(R.drawable.github_circle) .setOnClickListener( ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse("https://github.com/Primokorn"))) .build()); MaterialAboutCard.Builder convenienceCardBuilder = new MaterialAboutCard.Builder(); convenienceCardBuilder.title(R.string.about_title_libs); convenienceCardBuilder .addItem(new MaterialAboutActionItem.Builder().text("Android Onboarder") .subText(R.string.about_license_3).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Android Onboarder", "https://github.com/chyrta/AndroidOnboarder", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Glide") .subText(R.string.about_license_9).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Glide", "https://github.com/bumptech/glide", true, false)) .build()); convenienceCardBuilder .addItem( new MaterialAboutActionItem.Builder().text("Image Picker").subText(R.string.about_license_1) .icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Image Picker", "https://github.com/Mariovc/ImagePicker", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Material About Library") .subText(R.string.about_license_7).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Material About Library", "https://github.com/daniel-stoneuk/material-about-library", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Material Date Time Picker") .subText(R.string.about_license_2).icon(R.drawable.github_circle) .setOnClickListener( ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Material Date Time Picker", "https://github.com/wdullaer/MaterialDateTimePicker", true, false)) .build()); convenienceCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Material Design Icons") .subText(R.string.about_license_8).icon(R.drawable.github_circle) .setOnClickListener(ConvenienceBuilder.createWebViewDialogOnClickAction(c, "Material Design Icons", "https://github.com/Templarian/MaterialDesign", true, false)) .build()); return new MaterialAboutList(appCardBuilder.build(), authorCardBuilder.build(), authorCardBuilder2.build(), convenienceCardBuilder.build()); }