public interface IPluginActivity
Modifier and Type | Method and Description |
---|---|
String |
getPreviousBlurb() |
Bundle |
getPreviousBundle() |
String |
getResultBlurb(Bundle bundle) |
Bundle |
getResultBundle() |
boolean |
isBundleValid(Bundle bundle)
Validates the Bundle, to ensure that a malicious application isn't attempting to pass
an invalid Bundle.
|
void |
onPostCreateWithPreviousResult(Bundle previousBundle,
String previousBlurb)
Plug-in Activity lifecycle callback to allow the Activity to restore
state for editing a previously saved plug-in instance.
|
Bundle getPreviousBundle()
EXTRA_BUNDLE
that was
previously saved to the host and subsequently passed back to this Activity for further
editing. Internally, this method relies on isBundleValid(android.os.Bundle)
. If
the bundle exists but is not valid, this method will return null.String getPreviousBlurb()
EXTRA_STRING_BLURB
that was
previously saved to the host and subsequently passed back to this Activity for further
editing.boolean isBundleValid(Bundle bundle)
Validates the Bundle, to ensure that a malicious application isn't attempting to pass an invalid Bundle.
bundle
- The plug-in's Bundle previously returned by the edit
Activity. bundle
should not be mutated by this method.bundle
is valid for the plug-in.void onPostCreateWithPreviousResult(Bundle previousBundle, String previousBlurb)
bundle
will have been
validated by isBundleValid(android.os.Bundle)
prior to this
method being called. If isBundleValid(android.os.Bundle)
returned false, then this
method will not be called. This helps ensure that plug-in Activity subclasses only have to
worry about bundle validation once, in the isBundleValid(android.os.Bundle)
method.
Note this callback only occurs the first time the Activity is created, so it will not be
called
when the Activity is recreated (e.g. savedInstanceState != null
) such as after a
configuration change like a screen rotation.
previousBundle
- Previous bundle that the Activity saved.previousBlurb
- Previous blurb that the Activity savedBundle getResultBundle()
null
if a valid Bundle cannot
be generated.