I am using an intent service to compress few video files using FFMPEG library and after compression, store these files on a server using FTP. So, I started a thread to wait for FFPEG execute()
method until it finished successfully.
Then, I store these files on the server using FTP.
The work is done correctly, but in the end it returns illegalStateException
:
MessageQueue: Handler (android.view.ViewRootImpl$ViewRootHandler) {8895619} sending message to a Handler on a dead thread
If I have 10 files, this exception is returned 10 times. What could be the reason for this exception and how can I avoid it.
Here is the handler i am using:
fFmpeg.execute(command, new ExecuteBinaryResponseHandler() {
@Override
public void onFailure(String s) {
System.out.println(idx + "----------Failure: \n" + s.toString());
}
@Override
public void onSuccess(String s) {
System.out.println(idx+ "----------Success: \n" + s.toString());
}
@Override
public void onProgress(String s) {
}
@Override
public void onStart() {
System.out.println(idx+ " started");
}
@Override
public void onFinish() {
totalProcessedFileCount++;
System.out.println(idx + "*****************Finished "+ totalProcessedFileCount);
}
});