Picasso java.lang.IllegalStateException: Method call should not happen from the main thread

后端 未结 5 2052
后悔当初
后悔当初 2021-01-07 22:32

I am attempting to use Picasso to get three Bitmap images from a URL

public void onCreate(Bundle savedInstanceState) { 
  super.onC         


        
5条回答
  •  误落风尘
    2021-01-07 23:20

    try this:

    Handler uiHandler = new Handler(Looper.getMainLooper());
    uiHandler.post(new Runnable(){
        @Override
        public void run() {
            Picasso.with(Context)
                    .load(imageUrl)
                    .into(imageView);
        }
    });
    

提交回复
热议问题