There is a database from which output is performed in the List View. Strings of incomprehensible characters are displayed instead of data. What exactly is wrong here? Thanks in advance for the answers.
// Helper
public class Helper extends SQLiteAssetHelper { private static final String DBName ="BookD.sqlite"; private static final int DBV=1; private SQLiteDatabase db; public Helper(Context context) { super(context,DBName,null,DBV); } public Helper open() throws SQLiteException { db =getWritableDatabase(); return this; } public ArrayList<Object[]> geData() { // TODO Auto-generated method stub String[]columns=new String[]{"id","title","author"}; Cursor c =db.query("books", columns, null, null, null, null, null); ArrayList<Object[]> array = new ArrayList<>(); if (c.moveToFirst()) { do { Object[] obj =new Object[3]; obj[0]=c.getInt(0); obj[1]=c.getString(1); obj[2]=c.getString(2); array.add(obj); } while (c.moveToNext()); }return array; }}
// MainActivity
public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Helper helper= new Helper(getApplicationContext()); ListView lv = (ListView) findViewById(R.id.listMe); Helper info = new Helper(this); info.open(); ArrayList<Object[]> array = info.geData(); info.close(); lv.setAdapter(new ArrayAdapter<Object[]>(this, android.R.layout.simple_list_item_1,array));