From f413599ba62605b0d5378b03f531a4b5fae990f5 Mon Sep 17 00:00:00 2001 From: zkp <3138559151@qq.com> Date: Mon, 18 Dec 2023 21:21:24 +0800 Subject: [PATCH] =?UTF-8?q?cmt=EF=BC=9ANoteWidgetProvider=20mcmt=EF=BC=9Ao?= =?UTF-8?q?nDeleted,=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notes/widget/NoteWidgetProvider.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java b/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java index d5a473a..5b8c03b 100644 --- a/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java +++ b/src/main/java/net/micode/notes/widget/NoteWidgetProvider.java @@ -32,6 +32,15 @@ import net.micode.notes.tool.ResourceParser; import net.micode.notes.ui.NoteEditActivity; import net.micode.notes.ui.NotesListActivity; +/** + * + * @ProjectName: minode + * @Package: net.micode.notes.widget + * @ClassName: NoteWidgetProvider + * @Description: 该类继承了AppWidgetProvider,实现挂件添加、删除、更新、启用等功能 + * @Author: 郑鲲鹏 + * @Date: 2023-12-18 21:13 + */ public abstract class NoteWidgetProvider extends AppWidgetProvider { public static final String [] PROJECTION = new String [] { NoteColumns.ID, @@ -45,6 +54,13 @@ public abstract class NoteWidgetProvider extends AppWidgetProvider { private static final String TAG = "NoteWidgetProvider"; + /** + * @method onDeleted + * @description 该方法用于删除Widget + * @date: 2023-12-18 21:18 + * @author: 郑鲲鹏 + * @return void + */ @Override public void onDeleted(Context context, int[] appWidgetIds) { ContentValues values = new ContentValues(); @@ -65,6 +81,13 @@ public abstract class NoteWidgetProvider extends AppWidgetProvider { null); } + /** + * @method update + * @description 该方法用于添加或更新Widget + * @date: 2023-12-18 21:11 + * @author: 郑鲲鹏 + * @return void + */ protected void update(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { update(context, appWidgetManager, appWidgetIds, false); }