Android picasso, error reason

半城伤御伤魂 提交于 2019-12-01 05:18:50

问题


How do I get error description in picasso :

    Picasso.with(context)
        .load(getUrl())
        .placeholder(R.drawable.user_thumbnail_big)
        .error(android.R.drawable.ic_dialog_alert)
        .into(viewModel.userImg);

Callback onError(https://square.github.io/picasso/javadoc/index.html) method also doesn't provide any arguments, I'm getting error images, but can't figureout why, logcat is also silent. Internet permission added.

Thanks for help.

EDIT

issue : Picasso library stopped working today with facebook graph picture links


回答1:


I had the same problem I solved it through :

The global instance listener receives HTTP exceptions for reporting upstream to a crash reporting service or analytics service.

regards to : https://github.com/square/picasso/issues/379

public class MyClass implements Picasso.Listener {
    @Override
    public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
    // Display the exception
    }
}


来源:https://stackoverflow.com/questions/27798391/android-picasso-error-reason

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!