• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Error with toolbar

RATNAJEE

Newbie
After installing and running APK file, the main activity was executed but the further activities were stopped. In logcat, i found the error (attached), ' The 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.' But my project need the toolbar. Can anyone help me to solve this problem?
 

Attachments

  • cam_tmp_1.jpeg
    cam_tmp_1.jpeg
    636.8 KB · Views: 162
After installing and running APK file, the main activity was executed but the further activities were stopped. In logcat, i found the error (attached), ' The 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.' But my project need the toolbar. Can anyone help me to solve this problem?

Try to post any code or log instead of images as it's easier to sort through and help you.

Without looking at the image it sounds like you have both a Toolbar and ActionBar enabled. If you're looking to have a Toolbar then you need to change the base theme to one with "NoActionBar" in your styles.

Here's a tutorial for setting up a custom toolbar with sample code as well as the full project on github...
https://techstop.github.io/android-toolbar/
 
Last edited:
Back
Top Bottom