From 795c5433b309903976194639805e32f7fa93b3e5 Mon Sep 17 00:00:00 2001 From: ynmlzdwsp <2727940448@qq.com> Date: Sat, 23 Sep 2023 11:30:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/net/micode/notes/model/WorkingNote.java | 3 +++ app/src/main/java/net/micode/notes/tool/BackupUtils.java | 1 + .../main/java/net/micode/notes/ui/NotesListActivity.java | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/app/src/main/java/net/micode/notes/model/WorkingNote.java b/app/src/main/java/net/micode/notes/model/WorkingNote.java index be081e4..47a1ebb 100644 --- a/app/src/main/java/net/micode/notes/model/WorkingNote.java +++ b/app/src/main/java/net/micode/notes/model/WorkingNote.java @@ -124,6 +124,9 @@ public class WorkingNote { loadNote(); } + /** + * 通过查询指定ID的笔记数据,在Cursor中获取笔记的相关属性,并存储到相应的成员变量中 + */ private void loadNote() { Cursor cursor = mContext.getContentResolver().query( ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, mNoteId), NOTE_PROJECTION, null, diff --git a/app/src/main/java/net/micode/notes/tool/BackupUtils.java b/app/src/main/java/net/micode/notes/tool/BackupUtils.java index 39f6ec4..4617e99 100644 --- a/app/src/main/java/net/micode/notes/tool/BackupUtils.java +++ b/app/src/main/java/net/micode/notes/tool/BackupUtils.java @@ -311,6 +311,7 @@ public class BackupUtils { /** * Generate the text file to store imported data + * 生成一个存储在SD卡上的文件,并返回该文件对象 */ private static File generateFileMountedOnSDcard(Context context, int filePathResId, int fileNameFormatResId) { StringBuilder sb = new StringBuilder(); diff --git a/app/src/main/java/net/micode/notes/ui/NotesListActivity.java b/app/src/main/java/net/micode/notes/ui/NotesListActivity.java index 2fa42ce..752abcf 100644 --- a/app/src/main/java/net/micode/notes/ui/NotesListActivity.java +++ b/app/src/main/java/net/micode/notes/ui/NotesListActivity.java @@ -17,6 +17,7 @@ package net.micode.notes.ui; import android.R.menu; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; @@ -158,6 +159,10 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt } } + /** + * 从raw资源文件中读取应用信息,保存到SharedPreferences中, + * 并在保存完成后将PREFERENCE_ADD_INTRODUCTION值设为true,以标识应用信息已经读取并保存。 + */ private void setAppInfoFromRawRes() { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); if (!sp.getBoolean(PREFERENCE_ADD_INTRODUCTION, false)) { @@ -233,6 +238,9 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt mModeCallBack = new ModeCallback(); } + /** + *处理ListView的多选模式下的操作 + */ private class ModeCallback implements ListView.MultiChoiceModeListener, OnMenuItemClickListener { private DropdownMenu mDropDownMenu; private ActionMode mActionMode; @@ -498,6 +506,7 @@ public class NotesListActivity extends Activity implements OnClickListener, OnIt this.startActivityForResult(intent, REQUEST_CODE_NEW_NODE); } + @SuppressLint("StaticFieldLeak") private void batchDelete() { new AsyncTask>() { protected HashSet doInBackground(Void... unused) {