启动任何(或选定的)应用程序时启动我的活动
我正在开发一个学习应用程序。在其中,我有一个活动,用户可以从其设备上安装的所有应用程序的列表中选择一些应用程序。
现在,每当用户从应用程序列表中启动任何选定的应用程序时,我想启动我的活动。基本上我想通过我的活动覆盖所选的活动。一旦用户完成某些任务,用户应该返回到之前单击的应用程序。
如何“捕获”此“启动其他应用程序”部分?广播接收器?任何例子都会非常有帮助。如果有人通过参考链接为我指出正确的方向,我将非常感激。
这与锁定应用程序非常相似。但以一种非常严重扭曲的方式。 我知道我必须使用后台服务来监视用户活动。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要的话,您不会拦截任意应用程序启动。默默地这样做违反了 Android(或任何合理的)安全模型。
您可以做的是提供替代的主屏幕。
但是,如果您只有可用应用程序的列表视图,则没有什么可以阻止您在该列表活动中定义自定义行为。
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.