Skip to content

Instantly share code, notes, and snippets.

View petterh's full-sized avatar

Petter Hesselberg petterh

View GitHub Profile
@petterh
petterh / MainActivity.java
Last active June 30, 2020 09:34 — forked from alexjlockwood/MainActivity.java
Sample usage of the "android.app.Application.ActivityLifecycleCallbacks" class.
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// Always register before calling into the super class.
getApplication().registerActivityLifecycleCallbacks(new MyActivityLifecycleCallbacks(this));
super.onCreate(savedInstanceState);
}