belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1
AppLaunchChecker
public
class
AppLaunchChecker
extends Object
java.lang.Object | |
↳ | android.support.v4.app.AppLaunchChecker |
This class provides APIs for determining how an app has been launched. This can be useful if you want to confirm that a user has launched your app through its front door activity from their launcher/home screen, rather than just if the app has been opened in the past in order to view a link, open a document or perform some other service for other apps on the device.
Summary
Public constructors | |
---|---|
AppLaunchChecker()
|
Public methods | |
---|---|
static
boolean
|
hasStartedFromLauncher(Context context)
Checks if this app has been launched by the user from their launcher or home screen since it was installed. |
static
void
|
onActivityCreate(Activity activity)
Records the parameters of an activity's launch for later use by the other methods available on this class. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public constructors
Public methods
hasStartedFromLauncher
boolean hasStartedFromLauncher (Context context)
Checks if this app has been launched by the user from their launcher or home screen since it was installed.
To track this state properly you must call onActivityCreate(Activity)
in your launcher activity's onCreate(Bundle)
method.
Parameters | |
---|---|
context |
Context : Context to check |
Returns | |
---|---|
boolean |
true if this app has been started by the user from the launcher at least once |
onActivityCreate
void onActivityCreate (Activity activity)
Records the parameters of an activity's launch for later use by the other methods available on this class.
Your app should call this method in your launcher activity's
onCreate(Bundle)
method to track launch state.
If the app targets API 23 (Android 6.0 Marshmallow) or later, this state will be
eligible for full data backup and may be restored to the user's device automatically.
Parameters | |
---|---|
activity |
Activity : the Activity currently running onCreate
|
Annotations
Interfaces
- ActionBarDrawerToggle.Delegate
- ActionBarDrawerToggle.DelegateProvider
- ActivityCompat.OnRequestPermissionsResultCallback
- ActivityCompat.PermissionCompatDelegate
- FragmentManager.BackStackEntry
- FragmentManager.OnBackStackChangedListener
- LoaderManager.LoaderCallbacks
- NotificationCompat.Action.Extender
- NotificationCompat.Extender
- SharedElementCallback.OnSharedElementsReadyListener
- TaskStackBuilder.SupportParentable
Classes
- ActionBarDrawerToggle
- ActivityCompat
- ActivityManagerCompat
- ActivityOptionsCompat
- AlarmManagerCompat
- AppLaunchChecker
- AppOpsManagerCompat
- BundleCompat
- DialogFragment
- Fragment
- Fragment.SavedState
- FragmentActivity
- FragmentContainer
- FragmentController
- FragmentHostCallback
- FragmentManager
- FragmentManager.FragmentLifecycleCallbacks
- FragmentManagerNonConfig
- FragmentPagerAdapter
- FragmentStatePagerAdapter
- FragmentTabHost
- FragmentTransaction
- FrameMetricsAggregator
- JobIntentService
- ListFragment
- LoaderManager
- NavUtils
- NotificationCompat
- NotificationCompat.Action
- NotificationCompat.Action.Builder
- NotificationCompat.Action.WearableExtender
- NotificationCompat.BigPictureStyle
- NotificationCompat.BigTextStyle
- NotificationCompat.Builder
- NotificationCompat.CarExtender
- NotificationCompat.CarExtender.UnreadConversation
- NotificationCompat.CarExtender.UnreadConversation.Builder
- NotificationCompat.DecoratedCustomViewStyle
- NotificationCompat.InboxStyle
- NotificationCompat.MessagingStyle
- NotificationCompat.MessagingStyle.Message
- NotificationCompat.Style
- NotificationCompat.WearableExtender
- NotificationCompatExtras
- NotificationCompatSideChannelService
- NotificationManagerCompat
- RemoteInput
- RemoteInput.Builder
- ServiceCompat
- ShareCompat
- ShareCompat.IntentBuilder
- ShareCompat.IntentReader
- SharedElementCallback
- TaskStackBuilder
Exceptions