WEB开发网
开发学院手机开发Android 开发 Android 数据库与MapView总结 阅读

Android 数据库与MapView总结

 2010-11-05 00:54:34 来源:WEB开发网   
核心提示:intItemSelected = -1;ArrayAdapter adapter = new ArrayAdapter(EX10_06_03.this, R.layout.simple_list_item_single_choice,lstRestaurant);mListView01.setItemsCanFocu

intItemSelected = -1;

ArrayAdapter adapter = new ArrayAdapter

(

EX10_06_03.this, R.layout.simple_list_item_single_choice,

lstRestaurant

);

mListView01.setItemsCanFocus(true);

mListView01.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

mListView01.setAdapter(adapter);

}

}

@Override

public boolean onCreateOptionsMenu(Menu menu)

{

// TODO Auto-generated method stub

/* menu群组ID */

int idGroup1 = 0;

/* The order position of the item */

int orderItem1 = Menu.NONE;

int orderItem3 = Menu.NONE+2;

menu.add(idGroup1, MENU_ADD, orderItem1, R.string.str_manu1).

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;

上一页  13 14 15 16 17 18 19 20 21 22 23  下一页

Tags:Android 数据库 MapView

编辑录入:coldstar [复制链接] [打 印]
赞助商链接