Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网dbHelper.close();
}
intent.setClass(EX10_06_02.this, EX10_06_03.class);
startActivity(intent);
finish();
break;
case (MENU_DRAW):
if(dbHelper!=null&&dbHelper.getReadableDatabase().isOpen()){
dbHelper.close();
}
intent.setClass(EX10_06_02.this, EX10_06_04.class);
startActivity(intent);
finish();
break;
}
return super.onOptionsItemSelected(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() {
if(dbHelper!=null&&dbHelper.getReadableDatabase().isOpen()){
dbHelper.close();
}
super.onDestroy();
}
}
3。编辑餐馆
Java代码
package irdc.ex10_06;
import java.util.ArrayList;
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;
更多精彩
赞助商链接