Android: how to disable FEATURE_NO_TITLE

I want my Android application to work as shown below. 1) Portrait mode: with a title 2) Landscape mode: without a title (due to height restrictions)

I know that I can implement 1) using requestWindowFeature (Window.FEATURE_NO_TITLE), but how can I dynamically change from 1 to 2) when the phone is rotated?

+3
source share
2 answers

This answer assumes that you cannot change the function during the activity life cycle (as it happens when the orientation changes), so they recommend using their own header (go to the section " :: Edit : :):

Hiding the title in full screen?

:: Edit ::

, , , - , , setContentView().

, , ... ,

, , , onCreate .

http://stuffthathappens.com/blog/2008/11/26/android-lifecycle-triggers-part-2/

Diagram of lifecycle when orientation changes

:

http://developer.android.com/resources/tutorials/hello-world.html

, XML /res/layout -land. Android , . , Android .

+4

, . onCreate Display ( getWindowManager().getDefaultDisplay()) , / , , , .

+5

All Articles