Skip to content

Instantly share code, notes, and snippets.

Avatar

Petter Hesselberg petterh

View GitHub Profile
@petterh
petterh / MainActivity.java
Last active Jun 30, 2020 — forked from alexjlockwood/MainActivity.java
Sample usage of the "android.app.Application.ActivityLifecycleCallbacks" class.
View MainActivity.java
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);
}