안드로이드 개발 질문/답변
(글 수 45,052)
public class b extends Activity {
static SQLiteDatabase db;
//WordDBHelper mHelper;
TextView txtMsg;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.b);
//mHelper = new WordDBHelper(this.getApplicationContext());
txtMsg = (TextView)findViewById(R.id.txtMsg);
try {
openDatabase();
String dbPath=getApplicationContext().getDatabasePath("b1.db").getPath();
db.close();
Toast.makeText(this, "Finished", 1).show();
}
catch (Exception e)
{
Toast.makeText(this, e.getMessage(), 1).show();
}
}
private void openDatabase() {
try {
String dbPath=getApplicationContext().getDatabasePath("b1.db").getPath();
db = SQLiteDatabase.openDatabase("data/data/exem.simpletoelc/databases/b1.db",null,SQLiteDatabase.OPEN_READWRITE);
Toast.makeText(this, "DB좀열려라!", 1).show();
}
catch (Exception e)
{
Toast.makeText(this, e.getMessage(), 1).show();
}
}
}
DB열려라에서 바로 클로즈로 빠지내요ㅜ..ㅜ
화면에 정보를 뿌려 주지 않고 있습니다.
어디를 건들여야 될까요?