android - Populating a list view from SQLite Database -


i'm new android. i'm trying populate listview sqlite database.i know how using arrays. can me doing this? know there away adapt following code , using populating listview using sqlite don't know how it.

public void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.list_item);         final listview lt = (listview)findviewbyid(r.id.listview01);         list<string> w= new arraylist<string>();         arrayadapter<string> aa;         w.add("waka");         w.add("weka");         w.add("woka");         aa = new arrayadapter<string>(this, r.layout.listw, w);         lt.setadapter(aa);         lt.settextfilterenabled(true);         lt.setonitemclicklistener(new onitemclicklistener() {                  public void onitemclick(adapterview<?> a, view v, int position, long id) {                   final string aux= (string) lt.getitematposition(position);                   intent myintent = new intent(infolist.this, tablist.class);                   startactivity(myintent);             }});     } 

thanks

the best way poputaling listview data using content providers: http://developer.android.com/guide/topics/providers/content-providers.html

using content providers safe headaches regarding open/close operation database.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -