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.
有没有办法检索自电池充电以来的时间量?
似乎没有办法这样做BatteryManager,但他们在设置中向您展示了它。我在这里看到它source,但似乎没有办法抓住它。有什么帮助吗?
BatteryManager
您可以为ACTION_POWER_DISCONNECTED设置广播接收器,并跟踪上次广播的时间。