Android No Action Bar Glitch

184 views Asked by At

I'm just trying to use the no action bar. I don't know why this is failing to import.

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light.NoActionBar">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

Error states [2015-06-11 22:26:46 - Krowd1] D:\WorkSpace\Krowd1\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Light.NoActionBar'. [2015-06-11 22:26:46 - Krowd1]

I've tried doing what the posts at stack say to import the V7 support and stuff. But to do that it says access denied? What to do now?

2

There are 2 answers

2
nifCody On

To remove the action bar just type this code in your activity where you want to remove the actionbar.

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">

</style>

Hope its work!

0
Kaijju On

Which API are you using? The one you used will work upto API 9 only Hence you need to use

    <style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
    </style>

And make sure you've imported appcompat and extended your activity to AppCompactActivity
1.File->Import (android-sdk\extras\android\support\v7). Choose "appcompat"

2.Project-> properties->Android. In the section library "Add" and choose "appCompat"