使用滑行时出错 - 您无法为已销毁的活动启动加载

时间:2016-07-02 07:53:48

标签: android android-glide

恢复活动时,会发生此错误。尝试在方法onDestroy()或onDestroyView()中使用Glide.with(getActivity())。pauseRequests()或Glide.get(getActivity())。clearMemory(),没有任何实际工作。仍然得到这个错误。另外,尝试取消所有关于毁灭的凌空请求,仍然没有运气。

  

07-02 13:07:24.788 1406-1406 /? E / InputEventReceiver:异常   调度输入事件。       07-02 13:07:24.800 1406-1406 /? E / MessageQueue-JNI:MessageQueue回调中的异常:handleReceiveCallback 07-02 13:07:24.817   一四○六年至1406年/? E / MessageQueue-JNI:java.lang.IllegalArgumentException:   你不能为被破坏的活动开始加载07-02 13:07:24.817   一四○六年至1406年/? E / MessageQueue-JNI:at com.b.a.e.o.b(Unknown Source)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   com.b.a.e.o.a(Unknown Source)07-02 13:07:24.817 1406-1406 /?   E / MessageQueue-JNI:at com.b.a.e.o.a(Unknown Source)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   com.b.a.f.b(Unknown Source)07-02 13:07:24.817 1406-1406 /?   E / MessageQueue-JNI:at   io.mi.ra.kee.ui.adapter.ListViewAdapter $ CellFeedViewHolder.a(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   io.mi.ra.kee.ui.adapter.ListViewAdapter.onBindViewHolder(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.RecyclerView $ Adapter.onBindViewHolder(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.RecyclerView $ Adapter.bindViewHolder(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.RecyclerView $ Recycler.getViewForPosition(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.RecyclerView $ Recycler.getViewForPosition(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.LinearLayoutManager $ LayoutState.next(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.LinearLayoutManager.layoutChunk(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.LinearLayoutManager.fill(未知来源)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.LinearLayoutManager.scrollBy(未知来源)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.RecyclerView.scrollByInternal(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.widget.RecyclerView.onTouchEvent(未知来源)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.View.dispatchTouchEvent(View.java:8388)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2424)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2158)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   com.android.internal.policy.impl.PhoneWindow $ DecorView.superDispatchTouchEvent(PhoneWindow.java:2314)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1692)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.app.Activity.dispatchTouchEvent(Activity.java:2739)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   io.mi.ra.kee.ui.activity.BaseActivity.dispatchTouchEvent(未知   来源)07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.view.n.dispatchTouchEvent(未知来源)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.support.v7.view.n.dispatchTouchEvent(未知来源)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   com.android.internal.policy.impl.PhoneWindow $ DecorView.dispatchTouchEvent(PhoneWindow.java:2275)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.View.dispatchPointerEvent(View.java:8578)07-02   13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewRootImpl $ ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4021)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewRootImpl $ ViewPostImeInputStage.onProcess(ViewRootImpl.java:3887)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3449)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3502)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3468)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewRootImpl $ AsyncInputStage.forward(ViewRootImpl.java:3578)   07-02 13:07:24.817 1406-1406 /? E / MessageQueue-JNI:at   android.view.ViewRootImp

1 个答案:

答案 0 :(得分:0)

在另一个问题中回答了这个问题,但我通过获取和使用ApplicationContext来解决这个问题

                    Glide.with(context.getApplicationContext())
                            .using(new FirebaseImageLoader())
                            .load(storageReference)
                            .signature(new StringSignature(uri.toString()))
                            .diskCacheStrategy(DiskCacheStrategy.ALL)
                            .placeholder(placeHolder)
                            .into(imageView);