Android添加书签(二)(16)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:12 点击:次
}
mCursor.moveToPosition(position);
String url = mCursor.getString(Browser.HISTORY_PROJECTION_URL_INDEX);
WebIconDatabase.getInstance().releaseIconForPageUrl(url);
Uri uri = ContentUris.withAppendedId(Browser.BOOKMARKS_URI,
mCursor.getInt(Browser.HISTORY_PROJECTION_ID_INDEX));
int numVisits = mCursor.getInt(Browser.HISTORY_PROJECTION_VISITS_INDEX);
if (0 == numVisits) {
mContentResolver.delete(uri, null, null);
} else {
// It is no longer a bookmark, but it is still a visited site.
ContentValues values = new ContentValues();
values.put(Browser.BookmarkColumns.BOOKMARK, 0);
mContentResolver.update(uri, values, null, null);
}
refreshList();
}
/**
* Refresh list to recognize a change in the database.
*/
public void refreshList() {
searchInternal();
}
/**
* Search the database for bookmarks that match the input string.
*
* @param like
* String to use to search the database. Strings with spaces are
* treated as having multiple search terms using the OR operator.
* Search both the title and url.
*/
public void search() {
searchInternal();
}
/**
* Update the bookmark's favicon.
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>