我有一个服务(服务A)和一个应用(应用B)。I want to perform some operations in service A every time app B comes into foreground(visible to user).Is there any Listenercallback that will inform the service A when app B comes into foreground?I know polling method to check the app present on the top of the stack after some interval repeatedly but I want Listenercallback based solution, can anyone suggest?
谢谢
你应该创建 bindService
,当其他应用程序调用 bindService
onBind
里面 Service
调用,通过意图你就知道是什么app绑定了你的Service,就说明它在力地