Activity Manager in Android

Activity Manager will interact with overall activities running in the system.Using the Activity Manager, the Android System manages a stack of activities which are in different states (starting, running, paused, stopped, destroyed).


Source Code:

Android Source:

Activity manager commands:

$ adb shell am
usage: am [start|instrument]
       am start [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
                [-c <CATEGORY> [-c <CATEGORY>] ...]
                [-e <EXTRA_KEY> <EXTRA_VALUE> [-e <EXTRA_KEY> <EXTRA_VALUE> ...]
                [-n <COMPONENT>] [-D] [<URI>]

1. Launch activity from command prompt
    adb shell am start -n <package>/.<Activity Name>

2. To terminate Application
    adb shell am kill <package name>
    adb shell am force-stop <package name>

3. To start service
    adb shell am startservice <package name>/.<service class>

No comments:

Post a Comment