This is part of my class that i supposed to select * from a sqlite table, show them in a listview that has 4 textviews and one imageview.
database has these columns:
sqlite> select * from events;
_id title location date img_loc
---------- ---------- ---------- ---------- ---------------------------------------------------------------
1 office space today file:///storage/sdcard0/DCIM/OrangeClubPhotos/1370701231842.jpg
2 home street26 june null
3 wrjjfhwiru rkljfewlr 487598347 file:///storage/sdcard0/DCIM/OrangeClubPhotos/1370702333785.jpg
4 jojo jiji today file:///storage/sdcard0/DCIM/OrangeClubPhotos/1370702372846.jpg
5 office des camp right now null
6 bed no locatio right here null
7 home home nyc home June 8 file:///storage/sdcard0/DCIM/OrangeClubPhotos/1370714226736.jpg
so img_loc column has uri of the photos on sdcard.
String[] from = new String[]{DbHandler.column_id, DbHandler.column_name, DbHandler.column_location, DbHandler.column_date, DbHandler.img_loc};
int[] to = new int[] {R.id.textView1, R.id.textView2, R.id.textView3, R.id.textView4, R.id.photoInDb};
SimpleCursorAdapter simpleCurs = new SimpleCursorAdapter(this, R.layout.listviewfinal, c, from, to);
listView.setAdapter(simpleCurs);
simpleCurs.setViewBinder(new SimpleCursorAdapter.ViewBinder() {
@Override
public boolean setViewValue(View view, Cursor cursor, int i) {
return false;
}
});
however, i dont know how to get on the ImageView so then i can decompress it due to this error "Out of memory on a 20155408-byte allocation." (i get this error when i try to use the code above unchanged.)