Package es.situm.sdk.location
Enum ForegroundServiceNotificationOptions.TapAction
- java.lang.Object
-
- java.lang.Enum<ForegroundServiceNotificationOptions.TapAction>
-
- es.situm.sdk.location.ForegroundServiceNotificationOptions.TapAction
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ForegroundServiceNotificationOptions.TapAction>
- Enclosing class:
- ForegroundServiceNotificationOptions
public static enum ForegroundServiceNotificationOptions.TapAction extends java.lang.Enum<ForegroundServiceNotificationOptions.TapAction>
Predefined actions performed when tapping the Situm Foreground Service Notification.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DO_NOTHING
Do nothing when tapping the Notification.LAUNCH_APP
Launch the app's main activity using the information returned byPackageManager.getLaunchIntentForPackage(String)
.LAUNCH_SETTINGS
Launch the operating system settings screen for the current app.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ForegroundServiceNotificationOptions.TapAction
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ForegroundServiceNotificationOptions.TapAction[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LAUNCH_APP
public static final ForegroundServiceNotificationOptions.TapAction LAUNCH_APP
Launch the app's main activity using the information returned byPackageManager.getLaunchIntentForPackage(String)
.The Intent used with LAUNCH_APP contains an extra
SITUM_EXTRA_LAUNCH_APP
that allows you to detect whether the app launch comes from a notification. You can check this extra in your activity to determine the source of the launch.protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent intent = getIntent(); if (intent != null && intent.hasExtra(ForegroundServiceNotificationOptions.SITUM_EXTRA_LAUNCH_APP)) { // Handle the launch from the notification handleNotificationLaunch(); } else { // Handle the normal launch handleNormalLaunch(); } }
-
DO_NOTHING
public static final ForegroundServiceNotificationOptions.TapAction DO_NOTHING
Do nothing when tapping the Notification.
-
LAUNCH_SETTINGS
public static final ForegroundServiceNotificationOptions.TapAction LAUNCH_SETTINGS
Launch the operating system settings screen for the current app.
-
-
Method Detail
-
values
public static ForegroundServiceNotificationOptions.TapAction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ForegroundServiceNotificationOptions.TapAction c : ForegroundServiceNotificationOptions.TapAction.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ForegroundServiceNotificationOptions.TapAction valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-