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**