I am making a diary application in android which is supposed to get some data from text fields.
When I run my app on the emulator, it gets successfully installed but as soon as I give input in the fields and I tap save option in the menu, emulator prompts that diary app has stopped working.
I am not able to find database folder in my app in emulator's file explorer which means my database is not making.
Here is my SQLite connection making and insertion in table code that i am writing in save item.
if(item.getItemId()==R.id.save){
EditText et=(EditText)findViewById(R.id.mood);
String mood=et.getText().toString();
et= (EditText)findViewById(R.id.weather);
String weather=et.getText().toString();
et= (EditText)findViewById(R.id.Text);
String text=et.getText().toString();
Date date= new Date();
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String strDate = sdfDate.format(date);
SQLiteDatabase db= openOrCreateDatabase("DiaryDatabase",MODE_PRIVATE,null);
db.execSQL("CREATE TABLE IF NOT EXIST DIARY ('Mood VARCHAR' , 'Weather VARCHAR' , 'Text VARCHAR' , 'Time VARCHAR' , 'Id INTEGER PRIMARY KEY');");
db.execSQL("INSERT INTO DIARY VALUES(mood,weather,text,strDate,NULL);");
db.close();
}