SQLite的小例子--备忘录(8)
来源:未知 责任编辑:责任编辑 发表时间:2014-01-20 07:51 点击:次
super.onCreate(savedInstanceState);
setContentView(R.layout.test_list);
this.getListView().setDividerHeight(2);
dbHelper = new MyAdapter(this);
dbHelper.open();
fillData();
registerForContextMenu(getListView());
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.listmenu, menu);
return true;
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
switch(item.getItemId())
{
case R.id.insert:
createTest();
return true;
}
return super.onMenuItemSelected(featureId, item);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId())
{
case R.id.insert:
createTest();
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onContextItemSelected(MenuItem item) {
switch(item.getItemId())
{
case DELETE_ID:
AdapterContextMenuInfo info = (AdapterContextMenuInfo)item.getMenuInfo();
dbHelper.deleteTest(info.id);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>