简体   繁体   中英

Monitoring Android activity life-cycle callbacks

I want to be able to launch an arbitrary app from a program (eg by executing the command "am start ", then have the program be notified in some way when the life-cycle callbacks (eg onStart, onStop) in the app's activity are called.

The problem is that I can not rely on having the app's source code, so can not modify it to add code to the app's implementations of those callbacks.

Is there any way to do this without modifying the Android activity manager, or writing a custom activity manager?

常规活动管理器可以为您提供正在运行的任务的名称(getRunningTasks),但是恐怕没有一个可以启动或停止任务时实现回调的接口。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM