我想在Android 2.2版上安裝第一次。我已經在Android 2.3的完成,如何在Android 2.2的 在這裏做的是我的代碼如何在android 2.2中獲取firstInstallTime?
try
{
long installed = context.getPackageManager().getPackageInfo("com.simsys.securex", 0).firstInstallTime;
String DateTimeStamp=getDate(installed, "dd/MM/yyyy hh:mm:ss");
String dateTimeSync="Installed_Date:";
String dateTimeSync2=dateTimeSync.concat(DateTimeStamp);
TextView txtCurrentTime= (TextView)findViewById(R.id.textViewdatetime);
txtCurrentTime.setText(dateTimeSync2);
}
catch (NameNotFoundException e)
{
e.printStackTrace();
}
您應該看到http://stackoverflow.com/a/5311917/604421 :) – hrules6872 2012-09-30 14:44:28