glide image loading timeout increase

后端 未结 5 1071
半阙折子戏
半阙折子戏 2020-12-15 08:03

I am using glide to load images from URL. While I am fetching the images I am showing a loader in the image view. Some of the images being fetched are larger and therefore

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-15 08:19

    Shortest way to do that:

    Glide.with(this)
             .setDefaultRequestOptions(new RequestOptions()
             .timeout(30000))
             .load("https://stackoverflow.com/posts/58063088/edit")
             .placeholder(getResources().getDrawable(R.drawable.no_image))
             .error(getResources().getDrawable(R.drawable.no_image))                
             .into(imageView);
    

提交回复
热议问题