简体   繁体   中英

got error regarding sdk version in android

I got a error which says:

Call requires API level 3 (current min is 1): android.os.AsyncTask#

This is the code I used for retrieving data from database through PHP into listview . For that I ran the thread.

Here is the code:

public class FetchDataTask extends AsyncTask<String, Void, String>{
private final FetchDataListener listener;
private String msg;

public FetchDataTask(FetchDataListener listener) {// this is a exact error place
    this.listener = listener;
}

@Override
protected String doInBackground(String... params) {
    if(params == null) return null;

    //do something
}

How do I overcome this problem?

Right Click on Project And select properties and then select android and then change project build target

and also open AndroidManifest.xml and set :

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="9" />

instead of integer Value 1 change to 9 like above

在您的AndroidManifest.xml文件中将android:minSdkVersion="1"更改为android:minSdkVersion="3"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM