I am trying to rebuild the sample of this library:
https://github.com/umano/AndroidSlidingUpPanel
using Android Studio 1.5, however when it gets to "setSupportActionBar((Toolbar) findViewById(R.id.main_toolbar));" it throws an exception.
public class DemoActivity extends AppCompatActivity {
private static final String TAG = "DemoActivity";
private SlidingUpPanelLayout mLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo);
setSupportActionBar((Toolbar) findViewById(R.id.main_toolbar));
exception:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.sothree.slidinguppanel/com.sothree.slidinguppanel.demo.
DemoActivity}: java.lang.IllegalStateException:
This Activity already has an action bar supplied by the window decor.
Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to
false in your theme to use a Toolbar instead.
my styles.xml
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<item name="android:windowActionBar">false</item>
<item name="colorPrimary">#ffff9431</item>
<item name="colorPrimaryDark">#ffD56600</item>
I have windowActionBar set to false. I even tried to remove it, but it does not work.
I tried this thread but no success:
This Activity already has an action bar supplied by the window decor
any idea what is going on?