每次启动和销毁Android应用程序(非活动)时,活动管理器是否在android中提供回调? [英] Does the activity manager provides a callback in android, every time an android application (not activity) is started and destroyed ?

查看:86
本文介绍了每次启动和销毁Android应用程序(非活动)时,活动管理器是否在android中提供回调?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个Android应用程序,当安装在设备中的Android应用程序打开并关闭时,会发现该应用程序。

我在开发者网站上找不到任何实质内容。



我尝试了什么:



一个活动有生命周期方法,通过它我们可以知道什么时候创建一个活动以及何时销毁它但我想知道是否有任何支持来知道应用程序何时启动和停止。

我的意思是一个应用程序可能有多个活动,因此活动生命周期方法不会派上用场来确定解决方案。

解决方案

一些可以帮助你的好读物这个 [ ^ ]和这个 [ ^ ]


活动生命周期| Android开发者 [ ^

I want to develop an Android Application which finds, when an Android Application installed in the device, is opened and when the same is closed.
I couldn't find anything substantial in Developers website.

What I have tried:

An activity has lifecycle methods through which we know when an activity is created and when it is destroyed but I want to know is there any support to know when an application is started and stopped.
I mean an application could have more than one activity so activity lifecycle methods won't come in handy to determine the solution.

解决方案

A couple of good reads which shall help you are this[^] and this[^]


The Activity Lifecycle | Android Developers[^]


这篇关于每次启动和销毁Android应用程序(非活动)时,活动管理器是否在android中提供回调?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆