I have target sdk set as 3.2 and min sdk as 2.2, how can I use strictmode in my application, as I understand it is introduced but cannot really understand how to start using
Set the Android Manifest to something like this.
Use the below code in the onCreate Method.
int SDK_INT = android.os.Build.VERSION.SDK_INT;
if (SDK_INT>8){
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
Note: Disable the warning as you are already checking which version of the Android is going to use this code.
This Code will be activated if the Android version is higher than Android 2.2