org.telegram.messenger.ApplicationLoader Java Examples
The following examples show how to use
org.telegram.messenger.ApplicationLoader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChatAttachAlertLocationLayout.java From Telegram-FOSS with GNU General Public License v2.0 | 7 votes |
private Location getLastLocation() { if (Build.VERSION.SDK_INT >= 23 && getParentActivity().checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && getParentActivity().checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return null; } else { LocationManager lm = (LocationManager) ApplicationLoader.applicationContext.getSystemService(Context.LOCATION_SERVICE); List<String> providers = lm.getProviders(true); Location l = null; for (int i = providers.size() - 1; i >= 0; i--) { l = lm.getLastKnownLocation(providers.get(i)); if (l != null) { break; } } return l; } }
Example #2
Source File: ActionIntroActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 7 votes |
@Override public void onResume() { super.onResume(); if (currentType == ACTION_TYPE_NEARBY_LOCATION_ENABLED) { boolean enabled = true; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { LocationManager lm = (LocationManager) ApplicationLoader.applicationContext.getSystemService(Context.LOCATION_SERVICE); enabled = lm.isLocationEnabled(); } else if (Build.VERSION.SDK_INT >= 19) { try { int mode = Settings.Secure.getInt(ApplicationLoader.applicationContext.getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF); enabled = (mode != Settings.Secure.LOCATION_MODE_OFF); } catch (Throwable e) { FileLog.e(e); } } if (enabled) { presentFragment(new PeopleNearbyActivity(), true); } } }
Example #3
Source File: ConnectionsManager.java From TelePlus-Android with GNU General Public License v2.0 | 7 votes |
public static boolean isConnectedToWiFi() { try { ConnectivityManager connectivityManager = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService( Context.CONNECTIVITY_SERVICE); if (connectivityManager == null) return false; NetworkInfo netInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (netInfo != null && netInfo.getState() == NetworkInfo.State.CONNECTED) return true; } catch (Exception e) { FileLog.e(e); } return false; }
Example #4
Source File: ConnectionsManager.java From TelePlus-Android with GNU General Public License v2.0 | 7 votes |
public static boolean isConnectionSlow() { try { ConnectivityManager connectivityManager = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService( Context.CONNECTIVITY_SERVICE); if (connectivityManager == null) return false; NetworkInfo netInfo = connectivityManager.getActiveNetworkInfo(); if (netInfo.getType() == ConnectivityManager.TYPE_MOBILE) { switch (netInfo.getSubtype()) { case TelephonyManager.NETWORK_TYPE_1xRTT: case TelephonyManager.NETWORK_TYPE_CDMA: case TelephonyManager.NETWORK_TYPE_EDGE: case TelephonyManager.NETWORK_TYPE_GPRS: case TelephonyManager.NETWORK_TYPE_IDEN: return true; } } } catch (Throwable ignore) {} return false; }
Example #5
Source File: StatisticActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 7 votes |
private void recolorRecyclerItem(View child) { if (child instanceof ChartCell) { ((ChartCell) child).recolor(); } if (child instanceof ShadowSectionCell) { Drawable shadowDrawable = Theme.getThemedDrawable(ApplicationLoader.applicationContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow); Drawable background = new ColorDrawable(Theme.getColor(Theme.key_windowBackgroundGray)); CombinedDrawable combinedDrawable = new CombinedDrawable(background, shadowDrawable, 0, 0); combinedDrawable.setFullsize(true); child.setBackground(combinedDrawable); } if (child instanceof OverviewCell) { ((OverviewCell) child).updateColors(); } }
Example #6
Source File: IdenticonActivity.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private void fixLayout() { ViewTreeObserver obs = fragmentView.getViewTreeObserver(); obs.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { @Override public boolean onPreDraw() { if (fragmentView == null) { return true; } fragmentView.getViewTreeObserver().removeOnPreDrawListener(this); WindowManager manager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE); int rotation = manager.getDefaultDisplay().getRotation(); if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { linearLayout.setOrientation(LinearLayout.HORIZONTAL); } else { linearLayout.setOrientation(LinearLayout.VERTICAL); } fragmentView.setPadding(fragmentView.getPaddingLeft(), 0, fragmentView.getPaddingRight(), fragmentView.getPaddingBottom()); return true; } }); }
Example #7
Source File: ConnectionsManager.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
public static boolean isRoaming() { try { ConnectivityManager connectivityManager = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = connectivityManager != null ? connectivityManager.getActiveNetworkInfo() : null; if (netInfo != null) return netInfo.isRoaming(); } catch (Exception e) { FileLog.e(e); } return false; }
Example #8
Source File: ConnectionsManager.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
public static boolean isConnectedToWiFi() { try { ConnectivityManager connectivityManager = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService( Context.CONNECTIVITY_SERVICE); if (connectivityManager == null) return false; NetworkInfo netInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (netInfo != null && netInfo.getState() == NetworkInfo.State.CONNECTED) return true; } catch (Exception e) { FileLog.e(e); } return false; }
Example #9
Source File: ConnectionsManager.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
public static boolean isRoaming() { try { ConnectivityManager connectivityManager = (ConnectivityManager) ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = connectivityManager != null ? connectivityManager.getActiveNetworkInfo() : null; if (netInfo != null) return netInfo.isRoaming(); } catch (Exception e) { FileLog.e(e); } return false; }
Example #10
Source File: ConnectionsManager.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
public void init(int version, int layer, int apiId, String deviceModel, String systemVersion, String appVersion, String langCode, String systemLangCode, String configPath, String logPath, int userId, boolean enablePushConnection) { native_init(currentAccount, version, layer, apiId, deviceModel, systemVersion, appVersion, langCode, systemLangCode, configPath, logPath, userId, enablePushConnection, isNetworkOnline(), getCurrentNetworkType()); checkConnection(); BroadcastReceiver networkStateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { checkConnection(); FileLoader.getInstance(currentAccount).onNetworkChanged(isConnectionSlow()); } }; IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); ApplicationLoader.applicationContext.registerReceiver(networkStateReceiver, filter); }
Example #11
Source File: PopupNotificationActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
private void openCurrentMessage() { if (currentMessageObject == null) { return; } Intent intent = new Intent(ApplicationLoader.applicationContext, LaunchActivity.class); long dialog_id = currentMessageObject.getDialogId(); if ((int) dialog_id != 0) { int lower_id = (int) dialog_id; if (lower_id < 0) { intent.putExtra("chatId", -lower_id); } else { intent.putExtra("userId", lower_id); } } else { intent.putExtra("encId", (int) (dialog_id >> 32)); } intent.putExtra("currentAccount", currentMessageObject.currentAccount); intent.setAction("com.tmessages.openchat" + Math.random() + Integer.MAX_VALUE); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(intent); onFinish(); finish(); }
Example #12
Source File: LocationActivity.java From Telegram with GNU General Public License v2.0 | 6 votes |
private void showPermissionAlert(boolean byButton) { if (getParentActivity() == null) { return; } AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); if (byButton) { builder.setMessage(LocaleController.getString("PermissionNoLocationPosition", R.string.PermissionNoLocationPosition)); } else { builder.setMessage(LocaleController.getString("PermissionNoLocation", R.string.PermissionNoLocation)); } builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), (dialog, which) -> { if (getParentActivity() == null) { return; } try { Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setData(Uri.parse("package:" + ApplicationLoader.applicationContext.getPackageName())); getParentActivity().startActivity(intent); } catch (Exception e) { FileLog.e(e); } }); builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); showDialog(builder.create()); }
Example #13
Source File: EmbedBottomSheet.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
public void exitFromPip() { if (webView == null || pipVideoView == null) { return; } if (ApplicationLoader.mainInterfacePaused) { try { parentActivity.startService(new Intent(ApplicationLoader.applicationContext, BringAppForegroundService.class)); } catch (Throwable e) { FileLog.e(e); } } if (isYouTube) { runJsCode("showControls();"); } ViewGroup parent = (ViewGroup) webView.getParent(); if (parent != null) { parent.removeView(webView); } containerLayout.addView(webView, 0, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT, 0, 0, 0, 48 + 36 + (hasDescription ? 22 : 0))); setShowWithoutAnimation(true); show(); pipVideoView.close(); pipVideoView = null; }
Example #14
Source File: ShareAlert.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private void copyLink(Context context) { if (exportedMessageLink == null && linkToCopy == null) return; try { android.content.ClipboardManager clipboard = (android.content.ClipboardManager) ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE); android.content.ClipData clip = android.content.ClipData.newPlainText("label", linkToCopy != null ? linkToCopy : exportedMessageLink.link); clipboard.setPrimaryClip(clip); Toast.makeText(context, LocaleController.getString("LinkCopied", R.string.LinkCopied), Toast.LENGTH_SHORT).show(); } catch (Exception e) { FileLog.e(e); } }
Example #15
Source File: WallpapersListActivity.java From Telegram with GNU General Public License v2.0 | 6 votes |
private void fixLayoutInternal() { if (getParentActivity() == null) { return; } WindowManager manager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE); int rotation = manager.getDefaultDisplay().getRotation(); if (AndroidUtilities.isTablet()) { columnsCount = 3; } else { if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { columnsCount = 5; } else { columnsCount = 3; } } updateRows(); }
Example #16
Source File: InstantCameraView.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
private void saveLastCameraBitmap() { Bitmap bitmap = textureView.getBitmap(); if (bitmap != null && bitmap.getPixel(0, 0) != 0) { lastBitmap = Bitmap.createScaledBitmap(textureView.getBitmap(), 80, 80, true); if (lastBitmap != null) { Utilities.blurBitmap(lastBitmap, 7, 1, lastBitmap.getWidth(), lastBitmap.getHeight(), lastBitmap.getRowBytes()); try { File file = new File(ApplicationLoader.getFilesDirFixed(), "icthumb.jpg"); FileOutputStream stream = new FileOutputStream(file); lastBitmap.compress(Bitmap.CompressFormat.JPEG, 87, stream); } catch (Throwable ignore) { } } } }
Example #17
Source File: LocationActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
private Location getLastLocation() { if (Build.VERSION.SDK_INT >= 23 && getParentActivity().checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && getParentActivity().checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { return null; } else { LocationManager lm = (LocationManager) ApplicationLoader.applicationContext.getSystemService(Context.LOCATION_SERVICE); List<String> providers = lm.getProviders(true); Location l = null; for (int i = providers.size() - 1; i >= 0; i--) { l = lm.getLastKnownLocation(providers.get(i)); if (l != null) { break; } } return l; } }
Example #18
Source File: ActionIntroActivity.java From Telegram with GNU General Public License v2.0 | 6 votes |
@Override public void onResume() { super.onResume(); if (currentType == ACTION_TYPE_NEARBY_LOCATION_ENABLED) { boolean enabled = true; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { LocationManager lm = (LocationManager) ApplicationLoader.applicationContext.getSystemService(Context.LOCATION_SERVICE); enabled = lm.isLocationEnabled(); } else if (Build.VERSION.SDK_INT >= 19) { try { int mode = Settings.Secure.getInt(ApplicationLoader.applicationContext.getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF); enabled = (mode != Settings.Secure.LOCATION_MODE_OFF); } catch (Throwable e) { FileLog.e(e); } } if (enabled) { presentFragment(new PeopleNearbyActivity(), true); } } }
Example #19
Source File: IdenticonActivity.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private void fixLayout() { ViewTreeObserver obs = fragmentView.getViewTreeObserver(); obs.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { @Override public boolean onPreDraw() { if (fragmentView == null) { return true; } fragmentView.getViewTreeObserver().removeOnPreDrawListener(this); WindowManager manager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE); int rotation = manager.getDefaultDisplay().getRotation(); if (rotation == Surface.ROTATION_270 || rotation == Surface.ROTATION_90) { linearLayout.setOrientation(LinearLayout.HORIZONTAL); } else { linearLayout.setOrientation(LinearLayout.VERTICAL); } fragmentView.setPadding(fragmentView.getPaddingLeft(), 0, fragmentView.getPaddingRight(), fragmentView.getPaddingBottom()); return true; } }); }
Example #20
Source File: StickersAlert.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
private void onSubItemClick(int id) { if (stickerSet == null) { return; } String stickersUrl = "https://" + MessagesController.getInstance(currentAccount).linkPrefix + "/addstickers/" + stickerSet.set.short_name; if (id == 1) { ShareAlert alert = new ShareAlert(getContext(), null, stickersUrl, false, stickersUrl, false); if (parentFragment != null) { parentFragment.showDialog(alert); } else { alert.show(); } } else if (id == 2) { try { AndroidUtilities.addToClipboard(stickersUrl); Toast.makeText(ApplicationLoader.applicationContext, LocaleController.getString("LinkCopied", R.string.LinkCopied), Toast.LENGTH_SHORT).show(); } catch (Exception e) { FileLog.e(e); } } }
Example #21
Source File: ShareAlert.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private void copyLink(Context context) { if (exportedMessageLink == null && linkToCopy == null) return; try { android.content.ClipboardManager clipboard = (android.content.ClipboardManager) ApplicationLoader.applicationContext.getSystemService(Context.CLIPBOARD_SERVICE); android.content.ClipData clip = android.content.ClipData.newPlainText("label", linkToCopy != null ? linkToCopy : exportedMessageLink.link); clipboard.setPrimaryClip(clip); Toast.makeText(context, LocaleController.getString("LinkCopied", R.string.LinkCopied), Toast.LENGTH_SHORT).show(); } catch (Exception e) { FileLog.e(e); } }
Example #22
Source File: ThemesHorizontalListCell.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
public void selectTheme(Theme.ThemeInfo themeInfo) { if (themeInfo.info != null) { if (!themeInfo.themeLoaded) { return; } if (themeInfo.info.document == null) { presentFragment(new ThemeSetUrlActivity(themeInfo, null, true)); return; } } if (!TextUtils.isEmpty(themeInfo.assetName)) { Theme.PatternsLoader.createLoader(false); } if (currentType != ThemeActivity.THEME_TYPE_OTHER) { SharedPreferences.Editor editor = ApplicationLoader.applicationContext.getSharedPreferences("themeconfig", Activity.MODE_PRIVATE).edit(); editor.putString(currentType == ThemeActivity.THEME_TYPE_NIGHT || themeInfo.isDark() ? "lastDarkTheme" : "lastDayTheme", themeInfo.getKey()); editor.commit(); } if (currentType == ThemeActivity.THEME_TYPE_NIGHT) { if (themeInfo == Theme.getCurrentNightTheme()) { return; } Theme.setCurrentNightTheme(themeInfo); } else { if (themeInfo == Theme.getCurrentTheme()) { return; } NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.needSetDayNightTheme, themeInfo, false, null, -1); } updateRows(); int count = getChildCount(); for (int a = 0; a < count; a++) { View child = getChildAt(a); if (child instanceof InnerThemeView) { ((InnerThemeView) child).updateCurrentThemeCheck(); } } }
Example #23
Source File: VoIPHelper.java From Telegram with GNU General Public License v2.0 | 5 votes |
private static File getLogFile(long callID) { if (BuildVars.DEBUG_VERSION) { File debugLogsDir = new File(ApplicationLoader.applicationContext.getExternalFilesDir(null), "logs"); String[] logs = debugLogsDir.list(); if (logs != null) { for (String log : logs) { if (log.endsWith("voip" + callID + ".txt")) { return new File(debugLogsDir, log); } } } } return new File(getLogsDir(), callID + ".log"); }
Example #24
Source File: PhotoPickerActivity.java From Telegram with GNU General Public License v2.0 | 5 votes |
private void loadRecentSearch() { SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("web_recent_search", Activity.MODE_PRIVATE); int count = preferences.getInt("count", 0); for (int a = 0; a < count; a++) { String str = preferences.getString("recent" + a, null); if (str == null) { break; } recentSearches.add(str); } }
Example #25
Source File: PhotoPickerActivity.java From Telegram with GNU General Public License v2.0 | 5 votes |
private void saveRecentSearch() { SharedPreferences.Editor editor = ApplicationLoader.applicationContext.getSharedPreferences("web_recent_search", Activity.MODE_PRIVATE).edit(); editor.clear(); editor.putInt("count", recentSearches.size()); for (int a = 0, N = recentSearches.size(); a < N; a++) { editor.putString("recent" + a, recentSearches.get(a)); } editor.commit(); }
Example #26
Source File: ThemeActivity.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private void showPermissionAlert(boolean byButton) { if (getParentActivity() == null) { return; } AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setTitle(LocaleController.getString("AppName", R.string.AppName)); if (byButton) { builder.setMessage(LocaleController.getString("PermissionNoLocationPosition", R.string.PermissionNoLocationPosition)); } else { builder.setMessage(LocaleController.getString("PermissionNoLocation", R.string.PermissionNoLocation)); } builder.setNegativeButton(LocaleController.getString("PermissionOpenSettings", R.string.PermissionOpenSettings), new DialogInterface.OnClickListener() { @TargetApi(Build.VERSION_CODES.GINGERBREAD) @Override public void onClick(DialogInterface dialog, int which) { if (getParentActivity() == null) { return; } try { Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setData(Uri.parse("package:" + ApplicationLoader.applicationContext.getPackageName())); getParentActivity().startActivity(intent); } catch (Exception e) { FileLog.e(e); } } }); builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); showDialog(builder.create()); }
Example #27
Source File: ExternalActionActivity.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
@Override protected void onPause() { super.onPause(); actionBarLayout.onPause(); if (AndroidUtilities.isTablet()) { layersActionBarLayout.onPause(); } ApplicationLoader.externalInterfacePaused = true; onPasscodePause(); if (passcodeView != null) { passcodeView.onPause(); } }
Example #28
Source File: CameraScanActivity.java From Telegram with GNU General Public License v2.0 | 5 votes |
public CameraScanActivity(int type) { super(); CameraController.getInstance().initCamera(() -> { if (cameraView != null) { cameraView.initCamera(); } }); currentType = type; if (currentType == TYPE_QR) { qrReader = new QRCodeReader(); visionQrReader = new BarcodeDetector.Builder(ApplicationLoader.applicationContext).setBarcodeFormats(Barcode.QR_CODE).build(); } }
Example #29
Source File: ChatAttachAlertDocumentLayout.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
@Override void onDestroy() { try { if (receiverRegistered) { ApplicationLoader.applicationContext.unregisterReceiver(receiver); } } catch (Exception e) { FileLog.e(e); } parentAlert.actionBar.closeSearchField(); ActionBarMenu menu = parentAlert.actionBar.createMenu(); menu.removeView(sortItem); menu.removeView(searchItem); }
Example #30
Source File: PopupNotificationActivity.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private void handleIntent(Intent intent) { isReply = intent != null && intent.getBooleanExtra("force", false); popupMessages.clear(); if (isReply) { int account = intent != null ? intent.getIntExtra("currentAccount", UserConfig.selectedAccount) : UserConfig.selectedAccount; popupMessages.addAll(NotificationsController.getInstance(account).popupReplyMessages); } else { for (int a = 0; a < UserConfig.MAX_ACCOUNT_COUNT; a++) { if (UserConfig.getInstance(a).isClientActivated()) { popupMessages.addAll(NotificationsController.getInstance(a).popupMessages); } } } KeyguardManager km = (KeyguardManager) getSystemService(KEYGUARD_SERVICE); if (km.inKeyguardRestrictedInputMode() || !ApplicationLoader.isScreenOn) { getWindow().addFlags( WindowManager.LayoutParams.FLAG_DIM_BEHIND | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } else { getWindow().addFlags( WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); } if (currentMessageObject == null) { currentMessageNum = 0; } getNewMessage(); }