Why I am Getting Error 'Channel is unrecoverably broken and will be disposed!' Why I am Getting Error 'Channel is unrecoverably broken and will be disposed!' android android

Why I am Getting Error 'Channel is unrecoverably broken and will be disposed!'


One of the most common reasons I see that error is when I am trying to display an alert dialog or progress dialog in an activity that is not in the foreground. Like when a background thread that displays a dialog box is running in a paused activity.


I think that You have memory leaks somewhere. You can find tips to avoid leaking memory here. Also you can learn about tools to track it down here.


Have you used another UI thread? You shouldn't use more than 1 UI thread and make it look like a sandwich. Doing this will cause memory leaks.

I have solved a similar issue 2 days ago...

To keep things short: The main thread can have many UI threads to do multiple works, but if one sub-thread containing a UI thread is inside it, The UI thread may not have finished its work yet while it's parent thread has already finished its work, this causes memory leaks.

For example...for Fragment & UI application...this will cause memory leaks.

getActivity().runOnUiThread(new Runnable(){   public void run() {//No.1  ShowDataScreen();getActivity().runOnUiThread(new Runnable(){    public void run() {//No.2Toast.makeText(getActivity(), "This is error way",Toast.LENGTH_SHORT).show();    }});// end of No.2 UI new thread}});// end of No.1 UI new thread

My solution is rearrange as below:

getActivity().runOnUiThread(new Runnable(){   public void run() {//No.1ShowDataScreen();}});// end of No.1 UI new thread        getActivity().runOnUiThread(new Runnable(){   public void run() {//No.2Toast.makeText(getActivity(), "This is correct way",Toast.LENGTH_SHORT).show();}});// end of No.2 UI new thread

for you reference.

I am Taiwanese, I am glad to answer here once more.