开发者

Launch my Activity when any (or selected) Apps are launched

开发者 https://www.devze.com 2023-02-19 11:48 出处:网络
I\'m developing a Learning Application. In it, I have an Activity where the user can select some applications from a list of all the applications installed on his device.

I'm developing a Learning Application. In it, I have an Activity where the user can select some applications from a list of all the applications installed on his device.

Now, I'd like to launch my Activity whenever the user launches any of the selected applications from the app list. Basically I'd like to override the selected Activity by my activity. 开发者_如何转开发Once the user complete's some task, the user should be returned to the previously clicked Application.

How do I "Capture" this 'Launching other applications' part? BroadcastReceivers? Any example would be highly helpful. I'd be very grateful if anyone points me in the right direction with reference links.

This is very similar to a Lock Apps Application. But in a very badly twisted kind of way. I know I have to use a background service to monitor the user activity.


You don't intercept arbitrary application launches, if that's what you're after. Doing this silently goes against the Android (or any reasonable) security model.

What you can do is offer an alternative Home screen.

However, if you just have a list view of available applications, nothing stops you from defining custom behaviours within that list activity.

0

精彩评论

暂无评论...
验证码 换一张
取 消