Android添加书签(二)(5)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-26 22:12 点击:次
if (v == upButton && currentPos > 0) {
bookmarkAdapter.moveItemUp(currentPos);
currentPos--;
} else if (v == downButton && currentPos >= 0
&& currentPos < bookmarkAdapter.getCount() - 1) {
bookmarkAdapter.moveItemDown(currentPos);
currentPos++;
} else if (v == deleteButton) {
showDialog(DIALOG_YES_NO_MESSAGE);
} else if (v == topButton) {
currentPos = bookmarkAdapter.moveToTop(currentPos);
} else if (v == bottomButton) {
currentPos = bookmarkAdapter.moveToBottom(currentPos);
} else if (v == launchButton) {
String url = bookmarkAdapter.getUrl(currentPos);
if (url != null) {
Intent i = new Intent("android.intent.action.VIEW",
Uri.parse(url));
startActivity(i);
}
}
}
protected Dialog onCreateDialog(int id) {
if (id == DIALOG_YES_NO_MESSAGE) {
return new AlertDialog.Builder(Bookmarker.this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle("Confirm Delete")
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>