我们怎样才能检查的Andr​​oid的应用程序的近期推出的时间? [英] How can we check the recent launch time of an app in Android?

查看:124
本文介绍了我们怎样才能检查的Andr​​oid的应用程序的近期推出的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Android的应用程序?

I want to know the Recent launch time of an application in android?

推荐答案

您可以登录系统时在应用程序的主要活动的OnCreate。这个时候可以在类级别字段,然后设置和应用程序中的其他地方访问。 你也可以有类似的变量onResume(..)等

You can Log the System time in the onCreate of the Main Activity of the application. This time can be then set in a class level field and accessed from elsewhere in the application. You could also have similar variable for onResume(..) etc

public class MainActivity extends Activity { 
    long launchTime;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        launchTime = System.currentTimeMillis();
        ....
    }
}

这篇关于我们怎样才能检查的Andr​​oid的应用程序的近期推出的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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