我们怎样才能检查的Andr​​oid的应用程序的近期推出的时间?应用程序、近期、时间、Andr

由网友(炙年)分享简介:我想知道Android的应用程序?I want to know the Recent launch time of an application in android?推荐答案您可以登录系统时在应用程序的主要活动的OnCreate。这个时候可以在类级别字段,然后设置和应用程序中的其他地方访问。你也可以有类似的变...

我想知道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();
        ....
    }
}
阅读全文

相关推荐

最新文章