Picasso.with(getActivity().getApplicationContext()).load(imageString).resize(250, 250)
.into(image, new Callback() {
@Override
public void onSuccess() {
Log.e("profilepicsucess", "");
}
@Override
public void onError() {
Log.e("profilepicfalse :3", "");
}
});
When I try to download photo using Picasso, SOMETIMES my application crashed WITHOUT accessing onSuccess, onError Functions! and I have this in my logcat
(W/Settingsīš Setting airplane_mode_on has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.)
I searched for it I found that I should import :
import static android.provider.Settings.System.AIRPLANE_MODE_ON;
and write this function
static boolean isAirplaneModeOn(Context context) {
ContentResolver contentResolver = context.getContentResolver();
return Settings.System.getInt(contentResolver, AIRPLANE_MODE_ON, 0) != 0;
}
Actually I don't know WHERE to write it**
The reason you are getting the warning is because from Jelly Bean 4.2 and up, the airplane mode settings have moved to
Settings.Global
.Use this function to check the airplane mode:
However, I would need more detail to assist with the crashes.
This is how to use this function: