Fix android.os.NetworkOnMainThreadException when running on Android 3.0+