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:com.nononsenseapps.notepad.MainActivity.java
public void restartAndRefresh() { shouldRestart = false;/*from www .j ava 2s. com*/ Intent intent = getIntent(); overridePendingTransition(0, 0); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); finish(); overridePendingTransition(0, 0); startActivity(intent); }
From source file:com.gongpingjia.carplay.activity.chat.ChatActivity.java
/** * ?// w w w.ja v a 2 s . com * * @param view */ @Override public void onClick(View view) { String st1 = getResources().getString(R.string.not_connect_to_server); int id = view.getId(); if (id == R.id.btn_send) {// ??(?) String s = mEditTextContent.getText().toString(); sendText(s); } else if (id == R.id.btn_take_picture) { selectPicFromCamera();// } else if (id == R.id.btn_picture) { Intent intent = new Intent(self, PhotoSelectorActivity.class); intent.putExtra(PhotoSelectorActivity.KEY_MAX, 9); intent.putExtra("type", "type"); intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivityForResult(intent, REQUEST_CODE_LOCAL); // selectPicFromLocal(); // } else if (id == R.id.btn_location) { // ? startActivityForResult(new Intent(this, ChatMapActivity.class), REQUEST_CODE_MAP); } else if (id == R.id.iv_emoticons_normal) { // more.setVisibility(View.VISIBLE); iv_emoticons_normal.setVisibility(View.INVISIBLE); iv_emoticons_checked.setVisibility(View.VISIBLE); btnContainer.setVisibility(View.GONE); emojiIconContainer.setVisibility(View.VISIBLE); buttonPressToSpeak.setVisibility(View.GONE); edittext_layout.setVisibility(View.VISIBLE); hideKeyboard(); } else if (id == R.id.iv_emoticons_checked) { // ?? iv_emoticons_normal.setVisibility(View.VISIBLE); iv_emoticons_checked.setVisibility(View.INVISIBLE); btnContainer.setVisibility(View.VISIBLE); emojiIconContainer.setVisibility(View.GONE); more.setVisibility(View.GONE); } else if (id == R.id.btn_video) { // ? // Intent intent = new Intent(ChatActivity.this, // ImageGridActivity.class); // startActivityForResult(intent, REQUEST_CODE_SELECT_VIDEO); } else if (id == R.id.btn_file) { // // selectFileFromLocal(); } else if (id == R.id.btn_voice_call) { // ? if (!EMChatManager.getInstance().isConnected()) Toast.makeText(this, st1, 0).show(); else { // startActivity(new Intent(ChatActivity.this, // VoiceCallActivity.class).putExtra("username", // toChatUsername).putExtra("isComingCall", false)); // voiceCallBtn.setEnabled(false); // toggleMore(null); } } else if (id == R.id.btn_video_call) { // ? if (!EMChatManager.getInstance().isConnected()) Toast.makeText(this, st1, 0).show(); else { // startActivity(new Intent(this, VideoCallActivity.class) // .putExtra("username", toChatUsername).putExtra( // "isComingCall", false)); // videoCallBtn.setEnabled(false); // toggleMore(null); } } }
From source file:org.mareatlantica.android.NotificationsController.java
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) { if (messageObjects.isEmpty()) { return;/*from w w w . ja va 2 s .com*/ } boolean added = false; int oldCount = popupMessages.size(); HashMap<Long, Boolean> settingsCache = new HashMap<Long, Boolean>(); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); int popup = 0; for (MessageObject messageObject : messageObjects) { if (pushMessagesDict.containsKey(messageObject.messageOwner.id)) { continue; } long dialog_id = messageObject.getDialogId(); if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) { continue; } added = true; Boolean value = settingsCache.get(dialog_id); boolean isChat = (int) dialog_id < 0; popup = (int) dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); if (value == null) { int notify_override = preferences.getInt("notify2_" + dialog_id, 0); value = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0); settingsCache.put(dialog_id, value); } if (value) { if (popup != 0) { popupMessages.add(0, messageObject); } pushMessagesDict.put(messageObject.messageOwner.id, messageObject); pushMessages.add(0, messageObject); } } if (added) { notifyCheck = isLast; } if (!popupMessages.isEmpty() && oldCount != popupMessages.size()) { if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) { MessageObject messageObject = messageObjects.get(0); if (popup == 3 || popup == 1 && ApplicationLoader.isScreenOn || popup == 2 && !ApplicationLoader.isScreenOn) { Intent popupIntent = new Intent(ApplicationLoader.applicationContext, PopupNotificationActivity.class); popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_FROM_BACKGROUND); ApplicationLoader.applicationContext.startActivity(popupIntent); } } } }
From source file:org.telepatch.android.NotificationsController.java
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) { if (messageObjects.isEmpty()) { return;/*from w ww. j a v a 2s .c o m*/ } boolean added = false; int oldCount = popupMessages.size(); HashMap<Long, Boolean> settingsCache = new HashMap<Long, Boolean>(); int popup = 0; for (MessageObject messageObject : messageObjects) { if (pushMessagesDict.containsKey(messageObject.messageOwner.id)) { continue; } long dialog_id = messageObject.getDialogId(); if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) { continue; } if (isPersonalMessage(messageObject)) { personal_count++; } added = true; Boolean value = settingsCache.get(dialog_id); boolean isChat = (int) dialog_id < 0; //TODO per ora disattivo i popup che non funzionano bene. //popup = (int)dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); if (value == null) { int notify_override = preferences.getInt("notify2_" + dialog_id, 0); value = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0); settingsCache.put(dialog_id, value); } if (value) { if (popup != 0) { popupMessages.add(0, messageObject); } pushMessages.add(0, messageObject); pushMessagesDict.put(messageObject.messageOwner.id, messageObject); } } if (added) { notifyCheck = isLast; } if (!popupMessages.isEmpty() && oldCount != popupMessages.size()) { if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) { MessageObject messageObject = messageObjects.get(0); if (popup == 3 || popup == 1 && ApplicationLoader.isScreenOn || popup == 2 && !ApplicationLoader.isScreenOn) { Intent popupIntent = new Intent(ApplicationLoader.applicationContext, PopupNotificationActivity.class); popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_FROM_BACKGROUND); ApplicationLoader.applicationContext.startActivity(popupIntent); } } } }
From source file:me.cpwc.nibblegram.android.NotificationsController.java
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) { if (messageObjects.isEmpty()) { return;//from ww w . j a v a2s .c o m } boolean added = false; int oldCount = popupMessages.size(); HashMap<Long, Boolean> settingsCache = new HashMap<Long, Boolean>(); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); int popup = 0; for (MessageObject messageObject : messageObjects) { if (pushMessagesDict.containsKey(messageObject.messageOwner.id)) { continue; } long dialog_id = messageObject.getDialogId(); if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) { continue; } if (isPersonalMessage(messageObject)) { personal_count++; } added = true; Boolean value = settingsCache.get(dialog_id); boolean isChat = (int) dialog_id < 0; popup = (int) dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); if (value == null) { int notify_override = preferences.getInt("notify2_" + dialog_id, 0); value = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0); settingsCache.put(dialog_id, value); } if (value) { if (popup != 0) { popupMessages.add(0, messageObject); } pushMessages.add(0, messageObject); pushMessagesDict.put(messageObject.messageOwner.id, messageObject); } } if (added) { notifyCheck = isLast; } if (!popupMessages.isEmpty() && oldCount != popupMessages.size()) { if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) { MessageObject messageObject = messageObjects.get(0); if (popup == 3 || popup == 1 && ApplicationLoader.isScreenOn || popup == 2 && !ApplicationLoader.isScreenOn) { Intent popupIntent = new Intent(ApplicationLoader.applicationContext, PopupNotificationActivity.class); popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_FROM_BACKGROUND); ApplicationLoader.applicationContext.startActivity(popupIntent); } } } }
From source file:com.negaheno.android.NotificationsController.java
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) { if (messageObjects.isEmpty()) { return;//from ww w. ja va2 s .co m } boolean added = false; int oldCount = popupMessages.size(); HashMap<Long, Boolean> settingsCache = new HashMap<>(); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); int popup = 0; for (MessageObject messageObject : messageObjects) { if (pushMessagesDict.containsKey(messageObject.messageOwner.id)) { continue; } long dialog_id = messageObject.getDialogId(); if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) { continue; } if (isPersonalMessage(messageObject)) { personal_count++; } added = true; Boolean value = settingsCache.get(dialog_id); boolean isChat = (int) dialog_id < 0; popup = (int) dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); if (value == null) { int notify_override = preferences.getInt("notify2_" + dialog_id, 0); if (notify_override == 3) { int mute_until = preferences.getInt("notifyuntil_" + dialog_id, 0); if (mute_until >= ConnectionsManager.getInstance().getCurrentTime()) { notify_override = 2; } } value = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0); settingsCache.put(dialog_id, value); } if (value) { if (popup != 0) { popupMessages.add(0, messageObject); } pushMessages.add(0, messageObject); pushMessagesDict.put(messageObject.messageOwner.id, messageObject); } } if (added) { notifyCheck = isLast; } if (!popupMessages.isEmpty() && oldCount != popupMessages.size() && !AndroidUtilities.needShowPasscode(false) && !UserConfig.isWaitingForPasscodeEnter) { if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) { MessageObject messageObject = messageObjects.get(0); if (popup == 3 || popup == 1 && ApplicationLoader.isScreenOn || popup == 2 && !ApplicationLoader.isScreenOn) { Intent popupIntent = new Intent(ApplicationLoader.applicationContext, PopupNotificationActivity.class); popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_FROM_BACKGROUND); ApplicationLoader.applicationContext.startActivity(popupIntent); } } } }
From source file:org.hermes.android.NotificationsController.java
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) { if (messageObjects.isEmpty()) { return;//from w w w .j a v a 2 s.co m } boolean added = false; int oldCount = popupMessages.size(); HashMap<Long, Boolean> settingsCache = new HashMap<>(); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); int popup = 0; for (MessageObject messageObject : messageObjects) { if (pushMessagesDict.containsKey(messageObject.getId())) { continue; } long dialog_id = messageObject.getDialogId(); long original_dialog_id = dialog_id; if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) { playInChatSound(); continue; } if ((messageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_MENTION) != 0) { dialog_id = messageObject.messageOwner.from_id; } if (isPersonalMessage(messageObject)) { personal_count++; } added = true; Boolean value = settingsCache.get(dialog_id); boolean isChat = (int) dialog_id < 0; popup = (int) dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); if (value == null) { int notify_override = preferences.getInt("notify2_" + dialog_id, 0); if (notify_override == 3) { int mute_until = preferences.getInt("notifyuntil_" + dialog_id, 0); if (mute_until >= ConnectionsManager.getInstance().getCurrentTime()) { notify_override = 2; } } value = !(notify_override == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notify_override == 0); settingsCache.put(dialog_id, value); } if (value) { if (popup != 0) { popupMessages.add(0, messageObject); } pushMessages.add(0, messageObject); pushMessagesDict.put(messageObject.getId(), messageObject); if (original_dialog_id != dialog_id) { pushDialogsOverrideMention.put(original_dialog_id, 1); } } } if (added) { notifyCheck = isLast; } if (!popupMessages.isEmpty() && oldCount != popupMessages.size() && !AndroidUtilities.needShowPasscode(false) && !UserConfig.isWaitingForPasscodeEnter) { if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) { MessageObject messageObject = messageObjects.get(0); if (popup == 3 || popup == 1 && ApplicationLoader.isScreenOn || popup == 2 && !ApplicationLoader.isScreenOn) { Intent popupIntent = new Intent(ApplicationLoader.applicationContext, PopupNotificationActivity.class); popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_FROM_BACKGROUND); ApplicationLoader.applicationContext.startActivity(popupIntent); } } } }
From source file:org.vshgap.android.NotificationsController.java
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) { if (messageObjects.isEmpty()) { return;/*from w ww . j a v a2 s . c om*/ } boolean added = false; int oldCount = popupMessages.size(); HashMap<Long, Boolean> settingsCache = new HashMap<>(); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); int popup = 0; for (MessageObject messageObject : messageObjects) { if (pushMessagesDict.containsKey(messageObject.getId())) { continue; } long dialog_id = messageObject.getDialogId(); long original_dialog_id = dialog_id; if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) { playInChatSound(); continue; } if ((messageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_MENTION) != 0) { dialog_id = messageObject.messageOwner.from_id; } if (isPersonalMessage(messageObject)) { personal_count++; } added = true; Boolean value = settingsCache.get(dialog_id); boolean isChat = (int) dialog_id < 0; popup = (int) dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); if (value == null) { int notifyOverride = getNotifyOverride(preferences, dialog_id); value = !(notifyOverride == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notifyOverride == 0); settingsCache.put(dialog_id, value); } if (value) { if (popup != 0) { popupMessages.add(0, messageObject); } delayedPushMessages.add(messageObject); pushMessages.add(0, messageObject); pushMessagesDict.put(messageObject.getId(), messageObject); if (original_dialog_id != dialog_id) { pushDialogsOverrideMention.put(original_dialog_id, 1); } } } if (added) { notifyCheck = isLast; } if (!popupMessages.isEmpty() && oldCount != popupMessages.size() && !AndroidUtilities.needShowPasscode(false) && !UserConfig.isWaitingForPasscodeEnter) { if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) { MessageObject messageObject = messageObjects.get(0); if (popup == 3 || popup == 1 && ApplicationLoader.isScreenOn || popup == 2 && !ApplicationLoader.isScreenOn) { Intent popupIntent = new Intent(ApplicationLoader.applicationContext, PopupNotificationActivity.class); popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_FROM_BACKGROUND); ApplicationLoader.applicationContext.startActivity(popupIntent); } } } }
From source file:com.android.launcher3.Utilities.java
public static void restart(Context context, int delay) { if (delay == 0) { delay = 1;// w w w.j a v a 2s . c o m } Intent restartIntent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()); restartIntent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); PendingIntent intent = PendingIntent.getActivity(context, 0, restartIntent, PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); manager.set(AlarmManager.RTC, java.lang.System.currentTimeMillis() + delay, intent); java.lang.System.exit(2); }
From source file:org.telegramsecureplus.android.NotificationsController.java
public void processNewMessages(ArrayList<MessageObject> messageObjects, boolean isLast) { if (messageObjects.isEmpty()) { return;/*from w w w .ja v a2 s .c o m*/ } boolean added = false; int oldCount = popupMessages.size(); HashMap<Long, Boolean> settingsCache = new HashMap<>(); SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); int popup = 0; for (int a = 0; a < messageObjects.size(); a++) { MessageObject messageObject = messageObjects.get(a); if (pushMessagesDict.containsKey(messageObject.getId())) { continue; } long dialog_id = messageObject.getDialogId(); long original_dialog_id = dialog_id; if (dialog_id == openned_dialog_id && ApplicationLoader.isScreenOn) { playInChatSound(); continue; } if ((messageObject.messageOwner.flags & TLRPC.MESSAGE_FLAG_MENTION) != 0) { dialog_id = messageObject.messageOwner.from_id; } if (isPersonalMessage(messageObject)) { personal_count++; } added = true; Boolean value = settingsCache.get(dialog_id); boolean isChat = (int) dialog_id < 0; popup = (int) dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); if (value == null) { int notifyOverride = getNotifyOverride(preferences, dialog_id); value = !(notifyOverride == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notifyOverride == 0); settingsCache.put(dialog_id, value); } if (value) { if (popup != 0) { popupMessages.add(0, messageObject); } delayedPushMessages.add(messageObject); pushMessages.add(0, messageObject); pushMessagesDict.put(messageObject.getId(), messageObject); if (original_dialog_id != dialog_id) { pushDialogsOverrideMention.put(original_dialog_id, 1); } } } if (added) { notifyCheck = isLast; } if (!popupMessages.isEmpty() && oldCount != popupMessages.size() && !AndroidUtilities.needShowPasscode(false) && !UserConfig.isWaitingForPasscodeEnter) { if (ApplicationLoader.mainInterfacePaused || !ApplicationLoader.isScreenOn) { MessageObject messageObject = messageObjects.get(0); if (popup == 3 || popup == 1 && ApplicationLoader.isScreenOn || popup == 2 && !ApplicationLoader.isScreenOn) { Intent popupIntent = new Intent(ApplicationLoader.applicationContext, PopupNotificationActivity.class); popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION | Intent.FLAG_ACTIVITY_NO_USER_ACTION | Intent.FLAG_FROM_BACKGROUND); ApplicationLoader.applicationContext.startActivity(popupIntent); } } } }