I am new to JSON. I followed this tutorial to create sample app. When i try to copy the code to my eclipse it show error.
Call requires API level 9 (current min is 8): android.os.StrictMode#setThreadPolicy
Please advice. Thanks
Go to the android AndroidManifest.xml
In your File it is 8
<uses-sdk android:minSdkVersion="8" />
Change The SDK version to 9 like shown below
<uses-sdk android:minSdkVersion="9" />
Right Click on you Android Project>Android Tools>Clear Lint Markers
"Run Android Lint" makes some markers and the markers cause this error.
This worked for me so if you use this don't need to change the
<uses-sdk android:minSdkVersion="8" />
to 9
In AndroidManifest.xml you have defined minSdkVersion as 8
<uses-sdk android:minSdkVersion="8" />
Though in the you code you are using StrictMode which is supported fromA API level 9.
So either you can skip using StrictMode in your app or set midSdkVersion as 9.
To skip using StrictMode just remove these lines.
import android.os.StrictMode;
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build());
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