SerializationHelper
public class SerializationHelper
Class used to manage Ongoing Activity information as part of a Bundle or Notification.
Summary
Public methods |
|
|---|---|
static @NonNull void |
Copies an Ongoing Activity information from a bundle to another, without deserializing and serializing (this needs to be done before accessing the source Bundle) |
static @Nullable OngoingActivity |
create(@NonNull Notification notification)Deserializes the |
static @Nullable OngoingActivity |
Deserializes the |
static @NonNull boolean |
hasOngoingActivity(@NonNull Notification notification)Checks if the given notification contains information of an ongoing activity. |
Public methods
copy
@NonNull
public static void copy(@NonNull Bundle sourceBundle, @NonNull Bundle destinationBundle)
Copies an Ongoing Activity information from a bundle to another, without deserializing and serializing (this needs to be done before accessing the source Bundle)
create
@Nullable
@NonNull
public static OngoingActivity create(@NonNull Notification notification)
Deserializes the OngoingActivity from a notification.
| Parameters | |
|---|---|
@NonNull Notification notification |
the notification that may contain information about a Ongoing Activity. |
| Returns | |
|---|---|
OngoingActivity |
the data, or null of the notification doesn't contain Ongoing Activity data. |
create
@Nullable
@NonNull
public static OngoingActivity create(@NonNull Bundle bundle)
Deserializes the OngoingActivity from a Bundle.
| Returns | |
|---|---|
OngoingActivity |
the data, or null of the Bundle doesn't contain Ongoing Activity data. |
hasOngoingActivity
@NonNull
public static boolean hasOngoingActivity(@NonNull Notification notification)
Checks if the given notification contains information of an ongoing activity.