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) {