From 80530b77e43decb83991161987706d3582e116cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=81=A9?= <946579119@qq.com> Date: Wed, 12 Apr 2023 19:19:21 +0800 Subject: [PATCH] 4.12 --- .../micode/notes/ui/AlarmAlertActivity.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/net/micode/notes/ui/AlarmAlertActivity.java b/src/net/micode/notes/ui/AlarmAlertActivity.java index 85723be..37c468b 100644 --- a/src/net/micode/notes/ui/AlarmAlertActivity.java +++ b/src/net/micode/notes/ui/AlarmAlertActivity.java @@ -41,24 +41,27 @@ import java.io.IOException; public class AlarmAlertActivity extends Activity implements OnClickListener, OnDismissListener { - private long mNoteId; - private String mSnippet; + private long mNoteId;//数据库文本 + private String mSnippet;//闹钟提示ui private static final int SNIPPET_PREW_MAX_LEN = 60; - MediaPlayer mPlayer; + MediaPlayer mPlayer;//播放声音 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - requestWindowFeature(Window.FEATURE_NO_TITLE); + // + // + // + requestWindowFeature(Window.FEATURE_NO_TITLE);//页面显示 final Window win = getWindow(); win.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); if (!isScreenOn()) { - win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON - | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON - | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON - | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR); + win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON//保持窗口点亮 + | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON//点亮 + | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON//允许锁屏 + | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);//锁屏后闹钟响起点亮屏幕 } Intent intent = getIntent();