1. 程式人生 > >Glide錯誤java.lang.IllegalArgumentException: You cannot start a load for a destr

Glide錯誤java.lang.IllegalArgumentException: You cannot start a load for a destr

解決辦法 在使用Glide的那段程式碼加是否在主執行緒判斷

if(Util.isOnMainThread()) {
                                Glide.with(ClassifyItemDetailActivity.this).load(ConstantsYiBaiSong.CLASSIFY_LIST_ITEM_DETAIL_IMAGE
                                        + lists.get(i).get(
                                        "face"))
                                        .diskCacheStrategy
(DiskCacheStrategy.ALL).into(imageView); }

在onDestory加

@Override
    protected void onDestroy() {
        super.onDestroy();
        if(Util.isOnMainThread()) {
            Glide.get(this).clearMemory();
        }
        }

問題解決。不要問我為什麼 因為報錯的根源都是判斷結論不在主執行緒。

轉自:http://www.ithao123.cn/content-10795739.html

相關推薦

Glide錯誤java.lang.IllegalArgumentException: You cannot start a load for a destr

解決辦法 在使用Glide的那段程式碼加是否在主執行緒判斷 if(Util.isOnMainThread()) { Glide.with(ClassifyItemDetailActivity.this).lo

Glide-You cannot start a load for a destroyed activity

場景: 在獲取本地相簿的時候,載入大量資料,開啟介面,然後很快finish介面,就會出現You cannot start a load for a destroyed activity,因為finish的時候,圖片還沒有被夾在完,Glide.with(mContext).load(bitmapL

Glide異常:You cannot load start a load for a destory activity

     使用glide載入圖片,在一個Activity中使用了glide載入圖片後,首次進入頁面顯示正常,退出二次進入崩潰,直接報引數異常:You cannot  start a load for on a destory activity。g

spark-submit 提示錯誤java.lang.IllegalArgumentException: System memory 468189184 must be at least 4.7185

在執行spark-submit時會報錯,是因為記憶體不足導致的,但是配置了driver-memory和executor-memory時都不行,報錯:ERROR SparkContext: Error initializing SparkContext.java.lang.Il

Caused by: java.lang.IllegalArgumentException: Could not locate call adapter for rx.Observable錯誤

public class TRService { public static final String BASE_TRC_URL = "http://www.tuling123.com/openapi/"; private static Retrofit

錯誤 java.lang.IllegalArgumentException: parameter must be a descendant of this view 的解決方案

bug資訊: 10-16 17:27:20.250: D/AndroidRuntime(14662): Shutting down VM 10-16 17:27:20.250: W/dalvikvm(14662): threadid=1: thread exiting wi

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"

今天在配置spring-security.xml配置檔案時出錯 錯誤如下: 嚴重: Servlet.service() for servlet [security] in context with path [] threw exception java.lang.IllegalArgumentExcept

RecyclerView在Fragment Activity切換報錯You cannot start a load for a destroyed activity

java.lang.IllegalArgumentException: You cannot start a load for a destroyed activity BottomNavigationView中Fragment切換或者各種Activity切換的時候(這些Activity,F

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"

在學習SpringBoot整合SpringSecurity的時候,做簡單認證的時候出現這種錯誤。 是因為,在 進行認證的時候我自定義的認證UserDetailsService 的密碼沒有進行加密,所以 才會出現這種情況。新增以下方法即可: @Bean

【異常】java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.dnsResolver 的解決方案

pcl group lan cnblogs cat resolv artifact exceptio 網頁 起因:使用htmlunit爬取外部網頁的時候遇到這個異常:java.lang.IllegalArgumentException: Cannot locate decl

HTTP錯誤java.lang.IllegalArgumentException: Illegal character in scheme at index 0: ?http://xxxxxx

getname 技術分享 isp open closed ring 修改 bsp color 讀取T卡文件裏的域名,HTTP請求出現如下錯誤 java.lang.IllegalArgumentException: Illegal character in scheme a

記錄錯誤java.lang.RuntimeException: Unable to start activity ComponentInfo

android  activity打不開,具體錯誤如下: 01-02 00:02:25.495 E/AndroidRuntime(  984): FATAL EXCEPTION: main01-02 00:02:25.495 E/AndroidRuntime(  98

spring boot 配置https 報這個錯誤java.lang.IllegalArgumentException: Private key must be accompanied by certificate chain

  找了接近半天的時間,原來是那麼小的問題    server.ssl.key-store=test.jksserver.ssl.key-store-password=123456server.ssl.key-store-type=PKCS12server.ssl.key-a

JAVA 專案啟動時 報 java.lang.IllegalArgumentException: MALFORMED 的錯誤

其他人的修改UTF-8之類的解決方案沒有解決我的問題。 我的原因是:jackson-annotations-2.6.0   這個包名有這個¥ 字元,導致的報錯 找到原因解決方案就很簡單了,要麼去掉這個包,要麼升級這個包,我試了別的版本發現沒什麼問題。 如果你的不是這個原因的

Spring整合mybatis:Caused by: java.lang.IllegalArgumentException錯誤

java.lang.IllegalArgumentException     at org.springframework.asm.ClassReader.<init>(Unknown Source)     at org.springframew

SSH 框架集 java.lang.IllegalArgumentException: node to traverse cannot be null!

HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling

java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String錯誤解決

一、背景 在用mybatis編寫sql判斷時間大小時,報錯:  二、錯誤原因 編寫mybatis的XML檔案出錯,在判空時,加入了判斷空字串的語句,無法比較 java.util.Date型別與  java.lang.Stringd的"" <if test="

錯誤java.lang.IllegalArgumentException: attempt to create create event with null entity

java.lang.IllegalArgumentException: attempt to create create event with null entity org.hibernate.event.spi.PersistEvent.<init>(PersistEvent.java:4

Caused by: java.lang.IllegalArgumentException: argument type mismatch錯誤

2014-06-24 08:51:42,984 ERROR [main] (DefSchedulerEngine.java:157) - 排程引擎啟動異常 org.springframework.orm.hibernate3.HibernateSystemException

程式碼中傳送http請求, java.lang.IllegalArgumentException: Illegal character in query at index...,非法字元錯誤解決辦法

產生原因:url中有漢字或特殊字元(非字母和數字的字元),沒有轉碼。 解決辦法:將帶有特殊字元或漢字的引數進行轉碼,再放入url傳送即可。 例如:param1 = URLEncoder.encode(param1, "UTF-8");