我正在使用 mhandler.postDelayed(runnable,5000) 每 5 秒将数据写入文件。
当屏幕关闭时,我从文件中观察到 postDelayed(runnable,5000) 的时间。它在一段时间内是准确的,但在一小时后,postDelayed(runnable,5000) 的时间增加到 10 秒。
两小时后,postDelayed(runnable,5000) 的时间增加到 15 秒。三小时后,postDelayed(runnable,5000) 的时间增加到 20 秒,依此类推。
postDelayed 触发时机随时间变化,这似乎很奇怪。
我期待这个还是我的代码中有错误?