What is android: immersive attribute in android manifest file?

I was developing a Google glass app and I had a problem with my activity. They ended when I did not interact with them for 7-10 seconds. After the screen turned off and I tapped my glass to wake it up again, my activity disappeared and I was on the ok glass screen .

I searched a lot, but could not find a solution. Then I met this attribute android:immersivein Activity in the AndroidManifest.xml file .

After use android:immersive="true"in my activity (AndroidManifest.xml file). My activity remains alive even after the screen timeout, and my activity resumes when I press the glass touch panel. His behavior is how I presented the default behavior.

So, I was wondering what an attribute is android:immersiveand why there is no documentation on this? Also this attribute is available only in GDK?

I plug in the logs that were generated by the activity lifecycle so that people can better understand.

//LOGS GENERATED WHEN android:immersive="false" or NOT USED  

01-30 11:58:51.433: E/LifeCycle(5643): OnCreate()
01-30 11:58:51.433: E/LifeCycle(5643): onStart()
01-30 11:58:51.441: E/LifeCycle(5643): onResume()
01-30 11:59:05.566: E/LifeCycle(5643): onPause()
01-30 11:59:05.574: E/LifeCycle(5643): onSaveInstanceState()
01-30 11:59:05.581: E/LifeCycle(5643): onStop()
01-30 11:59:11.511: E/LifeCycle(5643): onRestart()
01-30 11:59:11.511: E/LifeCycle(5643): onStart()
01-30 11:59:11.535: E/LifeCycle(5643): onResume()
01-30 11:59:11.597: E/LifeCycle(5643): onPause()
01-30 11:59:11.988: E/LifeCycle(5643): onSaveInstanceState()
01-30 11:59:11.988: E/LifeCycle(5643): onStop()



//LOGS GENERATED WHEN android:immersive="true"

01-30 11:50:41.995: E/LifeCycle(4929): OnCreate()
01-30 11:50:41.995: E/LifeCycle(4929): onStart()
01-30 11:50:41.995: E/LifeCycle(4929): onResume()
01-30 11:50:56.324: E/LifeCycle(4929): onPause()
01-30 11:50:56.347: E/LifeCycle(4929): onSaveInstanceState()
01-30 11:50:56.347: E/LifeCycle(4929): onStop()
01-30 11:51:09.144: E/LifeCycle(4929): onRestart()
01-30 11:51:09.144: E/LifeCycle(4929): onStart()
01-30 11:51:09.167: E/LifeCycle(4929): onResume()
+3
source share
1 answer
+2

Source: https://habr.com/ru/post/1524060/


All Articles