Enum android_manifest::PersistableMode
source · [−]pub enum PersistableMode {
PersistRootOnly,
PersistAcrossReboots,
PersistNever,
}
Expand description
Defines how an instance of an activity is preserved within a containing task across device restarts.
Variants
PersistRootOnly
Default value
. When the system restarts, the activity task is preserved, but
only the root activity’s launching intent is used.
When your app’s launching intent loads your app’s root activity, the activity
doesn’t receive a PersistableBundle
object. Therefore,
don’t use onSaveInstanceState()
to preserve the state of your app’s
root activity across a device restart.
Note
This attribute value affects your app’s behavior only if it’s set on your app’s root activity.
PersistAcrossReboots
This activity’s state is preserved, along with the state of each activity higher
up the back stack
that has its own persistableMode attribute set to
persistAcrossReboots. If an activity doesn’t have a persistableMode attribute
that is set to persistAcrossReboots, or if it’s launched using the
Intent.FLAG_ACTIVITY_NEW_DOCUMENT
flag, then that activity, along with all
activities higher up the back stack, aren’t preserved.
When an intent loads an activity whose persistableMode attribute is set to
persistAcrossReboots
in your app, the activity receives a
PersistableBundle
object in its onCreate()
method. Therefore, you can
use onSaveInstanceState()
to preserve the state of an activity across a
device restart as long as its persistableMode attribute is set to
persistAcrossReboots
.
Note
This attribute value affects your app’s behavior even if it’s set on an activity other than your app’s root activity
PersistNever
The activity’s state isn’t preserved.
Note
This attribute value affects your app’s behavior only if it’s set on your app’s root activity.
Trait Implementations
sourceimpl Clone for PersistableMode
impl Clone for PersistableMode
sourcefn clone(&self) -> PersistableMode
fn clone(&self) -> PersistableMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PersistableMode
impl Debug for PersistableMode
sourceimpl Default for PersistableMode
impl Default for PersistableMode
sourceimpl<'de> Deserialize<'de> for PersistableMode
impl<'de> Deserialize<'de> for PersistableMode
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<PersistableMode> for PersistableMode
impl PartialEq<PersistableMode> for PersistableMode
sourceimpl Serialize for PersistableMode
impl Serialize for PersistableMode
sourceimpl YaDeserialize for PersistableMode
impl YaDeserialize for PersistableMode
fn deserialize<R: Read>(reader: &mut Deserializer<R>) -> Result<Self, String>
sourceimpl YaSerialize for PersistableMode
impl YaSerialize for PersistableMode
fn serialize<W: Write>(&self, writer: &mut Serializer<W>) -> Result<(), String>
fn serialize_attributes(
&self,
source_attributes: Vec<OwnedAttribute>,
source_namespace: Namespace
) -> Result<(Vec<OwnedAttribute>, Namespace), String>
impl StructuralPartialEq for PersistableMode
Auto Trait Implementations
impl RefUnwindSafe for PersistableMode
impl Send for PersistableMode
impl Sync for PersistableMode
impl Unpin for PersistableMode
impl UnwindSafe for PersistableMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more