@Override
public void onStart() {
super.onStart();
try {
DBHelper dbhelper = new DBHelper(this);
SQLiteDatabase db = dbhelper.getReadableDatabase();
Cursor accounts = db.query( Database.ACCOUNTS_TABLE_NAME,null,null,null,null,null,null);
String from [] = { Database.ACCOUNTS_ID, Database.ACCOUNTS_BANK, Database.ACCOUNTS_HOLDERS, Database.ACCOUNTS_BALANCE };
int to [] = { R.id.textAccountId,R.id.textBank, R.id.textHolder, R.id.textBalance};
SimpleCursorAdapter ca = new SimpleCursorAdapter(this,R.layout.account, accounts,from,to);
ListView listAccounts = (ListView) this.findViewById( R.id.listAccounts);
listAccounts.setAdapter(ca);
dbhelper.close();
} catch (Exception ex) {
Toast.makeText(this, ex.getMessage(), Toast.LENGTH_LONG).show();
}
}
I'm trying to use this open source application and working to turn it into material design as it has pretty much old GUI. It runs well on AVD but forcefully stops on real device (API 25).
The only thing I see in this code is that, SimpleCursorAdaptor is strike-through.
What should I do to be able to run it on a real device?