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.
我如何获得空闲时间(应用程序自启动以来的时间)以在 android 中运行应用程序?
我试图为android中所有正在运行的应用程序争取时间
首先,您需要在应用程序运行 onPause() 时找到当前时间,并在 onResume() 中找到当前时间。找出这两者之间的区别。你会找到它的。