Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio v1 - actionbar not showing

I've been using the beta version until now. Now that I've upgraded to v1, any new project that I start doesn't show the actionbar in the design view. Is there a workaround? It shows up fine on the devices I'm testing it on put just doesn't show in the design mode. The only thing different on the device compared to before is that the app icon doesn't show on the actionbar.

Solved: The issue was due to the theme.

Won't show the icon and doesn't show the action bar in the design editor:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

Will show the icon and action bar in the design mode

<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
like image 331
Phil Avatar asked Dec 10 '14 18:12

Phil


People also ask

What is ActionBar in Android?

Android ActionBar is a menu bar that runs across the top of the activity screen in android. Android ActionBar can contain menu items which become visible when the user clicks the “menu” button. In general an ActionBar consists of the following four components: App Icon: App branding logo or icon will be displayed here.

What is an ActionBar?

In Android applications, ActionBar is the element present at the top of the activity screen. It is a salient feature of a mobile application that has a consistent presence over all its activities. It provides a visual structure to the app and contains some of the frequently used elements for the users.

What is the difference between action bar and toolbar?

What is the difference between the toolbar and the action bar? The most obvious difference between the two is the updated visual design of the toolbar. The toolbar no longer includes an icon on the left side and decreases some of the spacing between the action items on the right side.


1 Answers

Android Studio by default creates new Application with Appcompat-v7. So your application theme was Theme.AppCompat.Light.DarkActionBar. And Material design does not support ActionBar. And that is the reason that you cannot see ActionBar as well as App icon in design view. If you want ActionBar like functionality then you can use toolbar.

By changing theme to android:Theme.Holo.Light.DarkActionBar solves issue but then your app will not be created with material design. (Choice is upto you).

like image 123
Pooja Avatar answered Oct 25 '22 04:10

Pooja