I want to know the Recent launch time of an application in android?
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();
....
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With