私は自分の問題が何であるかを理解しました。将来誰かを助けるためにここに答えを投稿しています。それは Android のバグか何か奇妙なものである可能性があります。エラーは投稿されていません。肝心なのは、 で GUI 呼び出しを行わないことScheduledThreadPoolExecutor
です。
ScheduledThreadPoolExecutor masterExecutor;
masterExecutor=new ScheduledThreadPoolExecutor(1);
masterExecutor.schedule(new Runnable(){
@Override
public void run() {
//Formerly, I ran the block of code here, that blocked.
runOnUiThread ( new Runnable()
{
@Override
public void run() {
//Now I moved the code inside of a runOnUiThread
}
});
}
},1000,TimeUnit.MILLISECONDS);