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

Android 数据库与MapView总结

 2010-11-05 00:54:34 来源:WEB开发网   
核心提示:menu.add(idGroup1, MENU_DRAW, orderItem3, R.string.str_manu3).setIcon(R.drawable.hipposmall);return super.onCreateOptionsMenu(menu);}@Overridepublic boolean onO

menu.add(idGroup1, MENU_DRAW, orderItem3, R.string.str_manu3).

setIcon(R.drawable.hipposmall);

return super.onCreateOptionsMenu(menu);

}

@Override

public boolean onOptionsItemSelected(MenuItem item)

{

// TODO Auto-generated method stub

Intent intent = new Intent();

switch(item.getItemId())

{

case (MENU_ADD):

/* 新建餐厅资料 */

intent.setClass(EX10_06.this, EX10_06_02.class);

startActivity(intent);

finish();

break;

case (MENU_EDIT):

/* 编辑数据 */

intent.setClass(EX10_06.this, EX10_06_03.class);

startActivity(intent);

finish();

break;

case (MENU_DRAW):

/* 前往系统随机数选择餐厅功能 */

intent.setClass(EX10_06.this, EX10_06_04.class);

startActivity(intent);

finish();

break;

}

return super.onOptionsItemSelected(item);

}

}

2。添加餐馆以及操作数据库

Java代码

package irdc.ex10_06;

import android.app.Activity;

import android.content.Intent;

import android.database.Cursor;

import android.os.Bundle;

import android.view.Menu;

import android.view.MenuItem;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.Button;

import android.widget.EditText;

public class EX10_06_02 extends Activity {

private EditText mEditText01, mEditText02, mEditText03;

private Button mButton01;

static final private int MENU_EDIT = Menu.FIRST + 1;

static final private int MENU_DRAW = Menu.FIRST + 2;

private MySQLiteOpenHelper dbHelper = null;

int version = 1;

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Android 数据库 MapView

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