I am using a handler onresume method which causes a sigbart error asking not to block ui threads. Here's the code I have:
@Override
public void onResume(){
super.onResume();
new Handler().postDelayed(() -> {
try {
refreshMypage();
}catch (Exception e){
e.printStackTrace();
}
convo.refreshMessage();
presenter.refreshMessages();
}, 2000);
}
Here's the error :
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 24971 (Thread-244)
How do I fix it such that it won't block the UI operations/thread and at the same time work as expected without crashes.