0

I've followed the plethora of helpful and thorough instructions around SO and the internet in general regarding removing ActionBars in an Activity. I've tried to do so via the onCreate() method and XML but my ActionBar has irritatingly remarkable resilience.

I tried this code in my onCreate() method and the notification bar disappeared, but the ActionBar did not.

I have, of course, tried appending android:theme="@android:style/Theme.NoTitleBar" and quite a few other .NoActionBar and .NoTitleBar themes in the XML to the first RelativeLayout (is this the right place to put it? It's the highest level automatically present), to no effect.

Any ideas as to why these methods have failed?

Community
  • 1
  • 1
userManyNumbers
  • 904
  • 2
  • 10
  • 26

2 Answers2

2

Here is the nuclear option. Extend your Activity as

public class MainActivity extends Activity{

    ...

}

instead of

public class MainActivity extends ActionBarActivity{

    ...

}
Yash Sampat
  • 30,051
  • 12
  • 94
  • 120
1

In your onCreate method, execute this code:

getActionBar().hide();
Marcus
  • 6,697
  • 11
  • 46
  • 89