Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网dbHelper.close();
}
Intent intent = new Intent();
intent.setClass(EX10_06_02.this, EX10_06_03.class);
startActivity(intent);
finish();
}
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
int idGroup1 = 0;
int orderItem2 = Menu.NONE + 1;
int orderItem3 = Menu.NONE + 2;
menu.add(idGroup1, MENU_EDIT, orderItem2, R.string.str_manu2).setIcon(
android.R.drawable.ic_dialog_info);
menu.add(idGroup1, MENU_DRAW, orderItem3, R.string.str_manu3).setIcon(
R.drawable.hipposmall);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Intent intent=new Intent();
switch (item.getItemId()) {
case (MENU_EDIT):
if(dbHelper!=null&&dbHelper.getReadableDatabase().isOpen()){
dbHelper.close();
}
intent.setClass(EX10_06_02.this, EX10_06_03.class);
startActivity(intent);
finish();
break;
case (MENU_DRAW):
if(dbHelper!=null&&dbHelper.getReadableDatabase().isOpen()){
dbHelper.close();
}
intent.setClass(EX10_06_02.this, EX10_06_04.class);
startActivity(intent);
finish();
break;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
@Override
protected void onDestroy() {
if(dbHelper!=null&&dbHelper.getReadableDatabase().isOpen()){
更多精彩
赞助商链接