Skip to content Skip to sidebar Skip to footer

Simplecursoradapter Not Working In Mainactivity

And please tell me am I using the String [] FROM correctly to map the cursor. When I am using a SimpleCursorAdapter in my oncreate method of MainActivity it is giving error The m

Solution 1:

create SimpleCursorAdapter object as :

adapter =new  SimpleCursorAdapter(MainActivity.this, 
         ^^^       android.R.layout.two_line_list_item,cursor,FROM,TO);

you forget to use new for creating object of SimpleCursorAdapter

and use ListView id to initialize list instead of R.layout.listview

list= (ListView) findViewById(R.id.listview);

Post a Comment for "Simplecursoradapter Not Working In Mainactivity"