Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私が持っていて、Handler handler = new Handler()それに対して遅延タスクを実行した場合、それが呼び出されたかどうかhandler.postDelayed(xxx, xxx)を確認することは可能ですか?postDelayed()
Handler handler = new Handler()
handler.postDelayed(xxx, xxx)
postDelayed()
Runnable を投稿するときのハンドラーは、「what」フィールド == 0 のメッセージを取得するため、理論的には を呼び出すことができますがhasMessages(0)、保留中の Runnable が指定されているかどうかを確認することはできません。たとえば、r0 と r1 を投稿するときに、r0 が保留中かどうかを確認できません。いいえ。
hasMessages(0)