【发布时间】:2018-05-09 08:54:59
【问题描述】:
我正在使用下面的代码来获取我的应用程序的安装时间
PackageManager p = this.getPackageManager();
ApplicationInfo apinf = null;
apinf = p.getApplicationInfo(this.getPackageName(), 0);
String apkFile = apinf.sourceDir;
installTime = new File(apkFile).lastModified();
如果我在更改一些源代码后重新安装 apk - 通过 android studio - installTime 不会更新。但是,如果我从我的设备中手动卸载应用程序。新的 installTime 下次会正确显示。
如何编写代码来检测android studio重新安装的apk文件的安装时间?
【问题讨论】:
标签: android android-studio installation