Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64aaa144 authored by dingfeisong's avatar dingfeisong
Browse files

Remove all pending messages when fragment destroyed



Remove all pending messages when the fragment has destroyed.
Otherwise, after fragment disattachs its context, an exception
will be reported when process the messages.

Bug:377166756

Change-Id: I333cedb45c0fe43b81abbfbe19e37f42f98def91
Signed-off-by: default avatardingfeisong <dingfeisong@xiaomi.corp-partner.google.com>
parent 94ea022a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -207,7 +207,9 @@ public class AddAppNetworksFragment extends InstrumentedFragment implements
    @Override
    public void onDestroy() {
        mWorkerThread.quit();

        if (mHandler.hasMessagesOrCallbacks()) {
            mHandler.removeCallbacksAndMessages(null);
        }
        super.onDestroy();
    }