From you log i see
Caused by: java.lang.NullPointerException
06-14 19:12:06.723: E/AndroidRuntime(5930): at com.tanzanite.operasoft.database.DataBaseHelper.fetchdata(DataBaseHelper.java:224)
06-14 19:12:06.723: E/AndroidRuntime(5930): at com.tanzanite.operasoft.activity.Sw_LoginScreenActivity.onCreate(Sw_LoginScreenActivity.java:49)
So, you need use debuger and set breackpoints on
Sw_LoginScreenActivity.java – on line 49 (i think there you try to fetch data)
DataBaseHelper.java – on 224 – there you try to fetch data from myDataBase
public Cursor fetchdata()
{
open();
Cursor c=myDataBase.query(TABLE_NAME,
new String[]{COLUMN_NAME,
COLUMN_TRUCKID,
},null, null, null, null, null);
c.moveToLast();
myDataBase.close();
return c;
}
But, in open() method
public DataBaseHelper open() throws SQLException
{
//myDataBase = dbHelper.getWritableDatabase();
return this;
}
You comment line with creating database instance – so next line “Cursor c=myDataBase.query(TABLE_NAME,” it’s not correct, because myDataBase is null.
You did not open connection to database.
solved Android:Sqlite database errors