This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
/**
* 便签小部件提供者,用于管理便签小部件的数据和界面更新。
*/
public abstract class NoteWidgetProvider extends AppWidgetProvider {
// 数据库查询字段投影
public static final String [] PROJECTION = new String [] {
NoteColumns.ID,
NoteColumns.BG_COLOR_ID,
NoteColumns.SNIPPET
};
// 列索引常量
public static final int COLUMN_ID = 0;
public static final int COLUMN_BG_COLOR_ID = 1;
public static final int COLUMN_SNIPPET = 2;
// 日志标签
private static final String TAG = "NoteWidgetProvider";
/**
* 当小部件被删除时调用。
* @param context 上下文对象
* @param appWidgetIds 被删除的小部件ID数组
*/
@Override
public void onDeleted(Context context, int[] appWidgetIds) {
// 更新数据库,将被删除小部件的WIDGET_ID设置为无效
}
/**
* 获取小部件相关的便签信息。
* @param context 上下文对象
* @param widgetId 小部件ID
* @return 便签信息游标
*/
private Cursor getNoteWidgetInfo(Context context, int widgetId) {