Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

simple cursor adapter requires minimum api 11 issue

I am working on a app , in which i require to populate list view from the database. I am getting compatibility issue in following code

   dataAdapter = new SimpleCursorAdapter(
    this, R.layout.eventlisting, 
    cursor, 
    columns, 
    to,
    0);

It requires min api level 11 , mine is 8. Is there any alternative for this to make this code work on api 8 as well. Can i use support library?

like image 811
user1918034 Avatar asked Dec 27 '22 11:12

user1918034


1 Answers

Try the SimpleCursorAdapter from the support class. It is used like the API 11+ version and it is already backwards compatible.

You have to download the Support Library , so you only need to change the import Like This way :

import android.support.v4.widget.SimpleCursorAdapter;
like image 111
Dixit Patel Avatar answered Jan 12 '23 05:01

Dixit Patel