-2

I am getting following error

Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

I have tried answers like this

getSupportActionBar().hide(); before setContentView(R.layout.activity_main);

but not sloved.how to solve?

sasikumar
  • 12,540
  • 3
  • 28
  • 48
  • Refer this link.its helps to solve your issue http://stackoverflow.com/questions/26515058/this-activity-already-has-an-action-bar-supplied-by-the-window-decor – sasikumar Jun 06 '15 at 09:58

1 Answers1

0

When using Toolbar class with AppCompat v7 support library build v22+, you must use a parent theme with NoActionBar. For example, Theme.AppCompat.NoActionBar

ecle
  • 3,952
  • 1
  • 18
  • 22