Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网setIcon(android.R.drawable.ic_menu_add);
menu.add(idGroup1, MENU_DRAW, orderItem3, R.string.str_manu3).
setIcon(R.drawable.hipposmall);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item)
{
// TODO Auto-generated method stub
Intent intent = new Intent();
switch(item.getItemId())
{
case (MENU_ADD):
/* 前往新建餐厅功能 */
if(dbHelper!=null &&
dbHelper.getReadableDatabase().isOpen())
{
dbHelper.close();
}
intent.setClass(EX10_06_03.this, EX10_06_02.class);
startActivity(intent);
finish();
break;
case (MENU_DRAW):
/* 前往系统随机数选择餐厅功能 */
if(dbHelper!=null &&
dbHelper.getReadableDatabase().isOpen())
{
dbHelper.close();
}
intent.setClass(EX10_06_03.this, EX10_06_04.class);
startActivity(intent);
finish();
break;
}
return super.onMenuItemSelected(featureId, 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()
{
// TODO Auto-generated method stub
if(dbHelper!=null &&
dbHelper.getReadableDatabase().isOpen())
{
dbHelper.close();
}
super.onDestroy();
}
}
package irdc.ex10_06;
import java.util.ArrayList;
更多精彩
赞助商链接