|
|
|
@ -33,8 +33,16 @@ import net.micode.notes.R;
|
|
|
|
|
import net.micode.notes.data.Notes.DataColumns;
|
|
|
|
|
import net.micode.notes.data.Notes.NoteColumns;
|
|
|
|
|
import net.micode.notes.data.NotesDatabaseHelper.TABLE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* NotesProvider 是一个 ContentProvider 实现,用于提供笔记系统的数据访问接口。
|
|
|
|
|
* 它封装了对数据库的增删改查操作,并支持搜索和建议查询功能。
|
|
|
|
|
*
|
|
|
|
|
* 主要职责包括:
|
|
|
|
|
* - 提供对 note 表和 data 表的标准 ContentProvider 接口访问
|
|
|
|
|
* - 支持 URI 匹配(UriMatcher)
|
|
|
|
|
* - 支持全文搜索与搜索建议
|
|
|
|
|
* - 自动通知数据变化以更新 UI
|
|
|
|
|
*/
|
|
|
|
|
public class NotesProvider extends ContentProvider {
|
|
|
|
|
private static final UriMatcher mMatcher;
|
|
|
|
|
|
|
|
|
|