Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网{
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_list);
mListView01 = (ListView)findViewById(R.id.myListView1);
dbHelper = new MySQLiteOpenHelper
(this, "mydb", null, version, tables, fieldNames, fieldTypes);
updateListView();
mListView01.setOnItemClickListener
(new ListView.OnItemClickListener()
{
public void onItemClick
(AdapterView parent, View v, int id, long arg3)
{
// TODO Auto-generated method stub
/* f_id字段 */
intItemSelected = id;
/* 弹出的菜单提供两种功能(编辑、删除) */
String[] dlgMenu=
{
getResources().getText(R.string.str_edit_it).toString(),
getResources().getText(R.string.str_del_it).toString()
};
new AlertDialog.Builder(EX10_06_03.this)
.setTitle(R.string.str_whattodo)
.setItems(dlgMenu, mListener1)
.setPositiveButton(R.string.str_cancel,
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
}
}).show();
}
});
}
private OnClickListener mListener1=
new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
// TODO Auto-generated method stub
switch(which)
{
case 0:
/* 数据修改 */
if(intItemSelected>=0)
{
/* 创建背景模糊效果的前景窗口 */
final Dialog d = new Dialog(EX10_06_03.this);
Window window = d.getWindow();
window.setFlags
(
WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
WindowManager.LayoutParams.FLAG_BLUR_BEHIND
更多精彩
赞助商链接