Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a88cd6f authored by Ian Lake's avatar Ian Lake
Browse files

Add Activity.registerActivityLifecycleCallbacks()

As an alternative to requiring developers
register/unregister ActivityLifecycleCallbacks
at the Application level, provide the same API
at the Activity level.

This allows you to get lifecycle callbacks scoped
to only a single Activity without overriding
each individual callback.

The callbacks are purposefully nested within
the Application scoped ActivityLifecycleCallbacks.

Test: new CTS test
BUG: 116118635
Change-Id: Iab6d841019010a0bf9d91fe889db82e0135b4b9c
parent 9ab9d46a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3803,6 +3803,7 @@ package android.app {
    method public void overridePendingTransition(int, int);
    method public void postponeEnterTransition();
    method public void recreate();
    method public void registerActivityLifecycleCallbacks(android.app.Application.ActivityLifecycleCallbacks);
    method public void registerForContextMenu(android.view.View);
    method public boolean releaseInstance();
    method public final deprecated void removeDialog(int);
@@ -3880,6 +3881,7 @@ package android.app {
    method public deprecated void stopManagingCursor(android.database.Cursor);
    method public void takeKeyEvents(boolean);
    method public void triggerSearch(java.lang.String, android.os.Bundle);
    method public void unregisterActivityLifecycleCallbacks(android.app.Application.ActivityLifecycleCallbacks);
    method public void unregisterForContextMenu(android.view.View);
    field public static final int DEFAULT_KEYS_DIALER = 1; // 0x1
    field public static final int DEFAULT_KEYS_DISABLE = 0; // 0x0
+307 −23

File changed.

Preview size limit exceeded, changes collapsed.