If you want to actually remove the action bar (not create it first), and not create it, and then just hide it right away, you can do this through themes or through code.
Via tags or stylized attributes :
Use one of the predefined system themes, for example, Theme.Holo.NoActionBar or its variants. This is the easiest way to do this.
If you want to define the use of attributes within your custom theme, you can do this:
<resources> <style name="MyTheme" parent="some_parent_theme"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> </style> </resources>
Now add this theme to your activity or application.
Through the code (make sure you call this before setContentView in Activity.onCreate):
requestWindowFeature(Window.FEATURE_NO_TITLE);
numan salati
source share