Back to project page DailySelfie.
The source code is released under:
Apache License
If you think the Android project DailySelfie listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package it.lusio.android.dailyselfie; /* w w w. j a va 2 s . co m*/ import android.app.Activity; import android.app.Application; import android.os.Bundle; import android.util.Log; import it.lusio.android.dailyselfie.alarm.AlarmSetter; public class ApplicationDailySelfie extends Application { private static int started = 0; private static int stopped = 0; public static boolean isApplicationVisible() { return started > stopped; } @Override public void onCreate() { registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() { @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) { } @Override public void onActivityStarted(Activity activity) { ++started; Log.d(Constants.TAG, "One Activity Started."); } @Override public void onActivityResumed(Activity activity) { } @Override public void onActivityPaused(Activity activity) { } @Override public void onActivityStopped(Activity activity) { ++stopped; Log.d(Constants.TAG, "One Activity Stopped."); } @Override public void onActivitySaveInstanceState(Activity activity, Bundle outState) { } @Override public void onActivityDestroyed(Activity activity) { } }); new AlarmSetter(getApplicationContext()).startAlarm(); } }