Вопрос

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top