I have a class not extend from ListActivity, so how can I replace this code without error?
SimpleCursorAdapter adapter = new SimpleCursorAdapter(
this,
R.layout.sbooks_row,
cursor, from,
to
);
setListAdapter(adapter);
An activity that displays a list of items by binding to a data source such as an array or Cursor, and exposes event handlers when the user selects an item. ListActivity hosts a ListView object that can be bound to different data sources, typically either an array or a Cursor holding query results.
ListView myList=(ListView)findViewById(android.R.id.list);
myList.setAdapter(adapter);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With