Tek Eye Logo

Tek Eye

Rendering Problems with WindowDecorActionBar

This brief article describes the android.support.v7.app.WindowDecorActionBar error that is displayed when an App's layout is viewed in Studio. A null pointer exception occurs when Android Studio attempts to show a layout in design mode after a project has been built.

Rendering Problems Error with WindowDecorActionBar

The error is easy to reproduce. Simply create a new project with an empty Activity. Run the project. Open the Activity's layout in Design view and the error is shown:

Rendering Problems
The following classes could not be displayed:

    - android.support.v7.app.WindowDecorActionBar (Open Class, Show Excpetion, Clear Cache)
    ... etc.

The cause is a null pointer exception:

    at android.support.v7.app.WindowDecorActionBar.getDecorToolbar(WindowDecorActionBar.java:240)
    at android.support.v7.app.WindowDecorActionBar.init(WindowDecorActionBar.java:197)
    at android.support.v7.app.WindowDecorActionBar.<init>(WindowDecorActionBar.java:189)
    ... etc.

Strangely clicking the Clear Cache link on the displayed error resolves it. As does opening and closing the project or Studio.

Another workaround from Stack Overflow is to edit styles.xml in the values folder. Add Base. in front of Theme.AppCompat.Light.DarkActionBar, i.e.:




Author:  Published:  

ShareSubmit to TwitterSubmit to FacebookSubmit to LinkedInSubmit to redditPrint Page

Do you have a question or comment about this article?

(Alternatively, use the email address at the bottom of the web page.)

 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.

Articles on:

Android Programming and Android Practice Projects, HTML, VPS, Computing, IT, Computer History, ↓markdown↓ CMS, C# Programming, Using Windows for Programming

Free Android Projects and Samples:

Android Examples, Android List Examples, Android UI Examples

Tek Eye Published Projects