SerializationHelper


public class SerializationHelper

Class used to manage Ongoing Activity information as part of a Bundle or Notification.

Summary

Public methods

copy

Added in 1.0.0
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)

Parameters
@NonNull Bundle sourceBundle

The bundle to get the Ongoing Activity data from

@NonNull Bundle destinationBundle

The bundle to put the Ongoing Activity data into.

create

Added in 1.0.0
public static @Nullable OngoingActivitycreate(@NonNull Bundle bundle)

Deserializes the OngoingActivity from a Bundle.

Parameters
@NonNull Bundle bundle

the bundle that may contain information about a Ongoing Activity.

Returns
@Nullable OngoingActivity

the data, or null of the Bundle doesn't contain Ongoing Activity data.

create

Added in 1.0.0
public static @Nullable OngoingActivitycreate(@NonNull Notification notification)

Deserializes the OngoingActivity from a notification.

Parameters
@NonNull Notification notification

the notification that may contain information about a Ongoing Activity.

hasOngoingActivity

Added in 1.0.0
public static boolean hasOngoingActivity(@NonNull Notification notification)

Checks if the given notification contains information of an ongoing activity.