0
    @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?

  • 1
    `SimpleCursorAdaptor` is not deprecated. That particular constructor is deprecated. You'll need to provide more information if you'd like us to diagnose the crash; i.e., the [stack trace](http://stackoverflow.com/questions/23353173), and any of your code it references. – Mike M. Oct 11 '17 at 07:36
  • Okay, So it is a basic database application which stores information like bank name, customer name, account number etc. My MainActivity (ListAccounts) is posted here https://pastebin.com/SC6mLxsQ – ADITYA GADEGAONKAR Oct 11 '17 at 07:40

0 Answers0