android 书签 ContentProvider 制作书签但在浏览器的书签中不可见
我正在使用 Android 的浏览器书签 ContentProvider 以编程方式创建新书签。书签已创建(我可以通过 ContentProvider 以编程方式检索它),但书签在浏览器书签视图中不可见。想法?
// Saving the bookmark via ContentProvider
final ContentValues bookmarkValues = new ContentValues();
bookmarkValues.put(Browser.BookmarkColumns.TITLE, title);
bookmarkValues.put(Browser.BookmarkColumns.URL, url);
final Uri newBookmark = getContentResolver().insert(Browser.BOOKMARKS_URI, bookmarkValues);
// Retrieving
Cursor cursor = getContentResolver().query(Browser.BOOKMARKS_URI,
null, null, null, Browser.BookmarkColumns.CREATED);
cursor.moveToFirst();
final String stitle = cursor.getString(cursor.getColumnIndex("title"));
final String surl = cursor.getString(cursor.getColumnIndex("url"));
I'm using Android's Browser Bookmark ContentProvider to create a new bookmark programatically. The bookmark is created (I can retrieve it programatically via the ContentProvider) but the bookmark isn't visible in the browser bookmark view. Thoughts?
// Saving the bookmark via ContentProvider
final ContentValues bookmarkValues = new ContentValues();
bookmarkValues.put(Browser.BookmarkColumns.TITLE, title);
bookmarkValues.put(Browser.BookmarkColumns.URL, url);
final Uri newBookmark = getContentResolver().insert(Browser.BOOKMARKS_URI, bookmarkValues);
// Retrieving
Cursor cursor = getContentResolver().query(Browser.BOOKMARKS_URI,
null, null, null, Browser.BookmarkColumns.CREATED);
cursor.moveToFirst();
final String stitle = cursor.getString(cursor.getColumnIndex("title"));
final String surl = cursor.getString(cursor.getColumnIndex("url"));
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要添加此值:
You need to add this value: