android - How should I be using .setAdapter here? /How do i get around not extending ListActivity? -
i have class extending tabactivity can't extend listactivity.
this hasn't problem until needed use method:
private static int[] = { r.id.catitem, r.id.budgetamount, }; private void showbudgetoutcome(cursor cursor) { //set data binding simplecursoradapter adapter = new simplecursoradapter( this, r.layout.itemsforbudgetlist, cursor, from, to); setlistadapter(adapter); }
obviously setlistadapter undefined. found snippet of code searching so
mlistview.setadapter(new arrayadapter<string>(this, r.layout.list_item, countries));
but don't understand parameters. tried altering suit me:
incomeview.setadapter(new simplecursoradapter<string>(this, r.layout.itemsforbudgetlist, adapter??));
i see mlistview users listview replaced that, , layout resource defining how each item in list looks guess. rest i'm not sure about. figure maybe want simple/cursoradapter since i'm working sqlite (see method)? have no idea countries meant , not sure data type need (presumably string know). if clear things me , tell me how use method above i'd greatful!
if want pull data database need subclass cursoradapter
. can call:
incomeview.setadapter(new mycursoradapter(whatever arguments, need));
Comments
Post a Comment