Android添加书签(二)(21)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:12 点击:次
((BookmarkItem) convertView).setSelected();
} else {
((BookmarkItem) convertView).setUnselected();
}
return convertView;
}
/**
* Return the title for this item in the list.
*/
public String getTitle(int position) {
return getString(Browser.HISTORY_PROJECTION_TITLE_INDEX, position);
}
/**
* Return the Url for this item in the list.
*/
public String getUrl(int position) {
return getString(Browser.HISTORY_PROJECTION_URL_INDEX, position);
}
/**
* Private helper function to return the title or url.
*/
private String getString(int cursorIndex, int position) {
if (position < 0 || position > mCount) {
return "";
}
mCursor.moveToPosition(position);
return mCursor.getString(cursorIndex);
}
private void bind(BookmarkItem b, int position) {
mCursor.moveToPosition(position);
String title = mCursor
.getString(Browser.HISTORY_PROJECTION_TITLE_INDEX);
b.setName(title);
String url = mCursor.getString(Browser.HISTORY_PROJECTION_URL_INDEX);
b.setUrl(url);
byte[] data = mCursor.getBlob(Browser.HISTORY_PROJECTION_FAVICON_INDEX);
if (data != null) {
b.setFavicon(BitmapFactory.decodeByteArray(data, 0, data.length));
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>