Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网import java.util.List;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;
import android.database.Cursor;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
/* 编辑餐厅数据Activity */
public class EX10_06_03 extends Activity
{
private ListView mListView01;
static final private int MENU_ADD = Menu.FIRST;
static final private int MENU_DRAW = Menu.FIRST+2;
private MySQLiteOpenHelper dbHelper=null;
/* version必须大于等于1 */
private int version = 1;
private List allRestaurantID;
private List allRestaurantName;
private List allRestaurantAddress;
private List allRestaurantCal;
private List lstRestaurant;
private int intItemSelected=-1;
/* 数据库数据表 */
private String tables[] = { "t_restaurant" };
/* 数据库字段名称 */
private String fieldNames[][] =
{
{ "f_id", "f_name", "f_address", "f_cal" }
};
/* 数据库字段数据类型 */
private String fieldTypes[][] =
{
{ "INTEGER PRIMARY KEY AUTOINCREMENT", "text" , "text", "text"}
};
@Override
protected void onCreate(Bundle savedInstanceState)
更多精彩
赞助商链接