0

As the title says, Android studio 2.1 creates the following code in a empty activity

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

}

All the boilerplate required to setup an ActionBar is missing, and typing and creating everything is cumbersome. Any fix for this?

ibrabeicker
  • 1,786
  • 2
  • 19
  • 31

1 Answers1

0

There are a lot of ways to do that, put the following code in onCreate(), before you set content view.

getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getSupportActionBar().hide();

Or you can define your theme like this answer.

Community
  • 1
  • 1
einverne
  • 6,454
  • 6
  • 45
  • 91