Android set request window feature( Window.FEATURE_ NO_ Title) invalid solution

Reprint please indicate the source: http://blog.csdn.net/java201159416/article/details/51940074

general app has a demand to hide the Android default Title bar, is usually used before setConvertView call requestWindowFeature (Window. FEATURE_NO_TITLE), after can sometimes find call this line of code has no effect, Very depressed.
through observation, before the Activity is to inherit the Activity, so is valid, and I am AppCompatActivity inherited, so can’t hide.
solution:
1. Let xxxActivity inherit the Activity
2. Inherit AppCompatActivity and call it in the onCreate method

if (getSupportActionBar() != null){
   getSupportActionBar().hide();
}

And then we’re done.

Read More: