Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| android:start [2021/03/13 00:31] – created jmerari | android:start [2021/05/12 15:21] (current) – jmerari | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| ==== Foreground Service ==== | ==== Foreground Service ==== | ||
| - | * Although | + | * Typical use case : Music Player keep playing |
| + | * The term "Foreground" | ||
| + | * There are valid scenarios to promote your app to the foreground: The prerequisites for using a foreground service are that your app is executing a task that is immediate, important (must complete), is perceptible to the user (most often because | ||
| + | * Apps that target Android 9 (API level 28) or higher and use foreground services must request the FOREGROUND_SERVICE permission. | ||
| + | * If your app targets Android 10 (API level 29) or higher and accesses location information in a foreground service, declare the location foreground service type as an attribute of your < | ||
| + | * If the user has granted the ACCESS_BACKGROUND_LOCATION permission to your app, the service can access location all the time. Otherwise, if the user has granted the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permission to your app, the service has access to location only while the app is running in the foreground (also known as " | ||
| ==== Background Service ==== | ==== Background Service ==== | ||
| ==== Bound Service ==== | ==== Bound Service ==== | ||
| Line 16: | Line 22: | ||
| A bound service runs only as long as another application component is bound to it. Multiple components can bind to the service at once, but when all of them unbind, the service is destroyed. | A bound service runs only as long as another application component is bound to it. Multiple components can bind to the service at once, but when all of them unbind, the service is destroyed. | ||
| - | ==== Reference | + | |
| - | [[https:// | + | ===== Fragment Lifecycle Event Sequence ===== |
| + | - onAttach | ||
| + | - onCreate | ||
| + | - onCreateView | ||
| + | - onViewCreated | ||
| + | - onActivityCreated | ||
| + | - onViewStateRestored | ||
| + | - onStart | ||
| + | - onResume | ||
| + | - onPause | ||
| + | - onStop | ||
| + | - onDestroyView | ||
| + | - onDestroy | ||
| + | - onDetach | ||
| + | |||
| + | ===== Background Thread ===== | ||
| + | - [[https:// | ||
| + | |||
| + | ==== References ==== | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||