I cant be able to show my data into a listview using this code which Ive found on a particular website. I am able to show all the images in listview but the data are not there! Someone please help!
db = new DBAdapter(this);
toptext = (TextView) findViewById (R.id.toptext);
bottomtext = (TextView) findViewById (R.id.bottomtext);
ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
HashMap<String, String> item;
for (int i = 0; i < 31; i++) {
item = new HashMap<String, String>();
item.put("Date:", "Saved Date" );
item.put("Title:", "Saved Title");
list.add(item);
}
SimpleAdapter notes = new SimpleAdapter(this, list, R.layout.view_list,
new String[] { "date", "title" },
new int[] {R.id.toptext, R.id.bottomtext });
setListAdapter(notes);
} catch(Throwable e){
Log.e("DBAdapter",e.toString());
}
What should I change or do? For clearer explanation you can mail me at [email protected] :)