Customizing action bar in android shows default action bar first -


I am new to Android, while while customizing the action bar, I saw that it was the first old (default) action bar Shows first, it shows the customized action bar. Also, I want to set the text color for the title of action bar. My code snippet is

  public class MainActivity ActionBarActivity Extension (MenuItem searchItem; Search View Searchview; @ Override Protected Zero to Create (Bundle Saved Instantstate) {Super.Nocrat (Saved Instantstate); Actionbar AB = MillSport ActionBar (); ab.setTitle ("Amendment"); ab.setIcon (R.drawable.ap); Ab.setBackgroundDrawable (New ColorDrawable (Color.parseColor ("# 00AA00")); ab.setSubtitle (" Amendment "); setContentView (R.layout.activity_main);  

I think there should be some stupid mistake.
please

Try it out ..
Create a Theme.xml as

& Gt; & lt; Item Name = "Android: Actionbarstyle" & gt; @ Style / MyActionbar & lt; / item & gt; & lt ;! - Other activity and action bar styles here - & gt; & Lt; / Style & gt; & Lt ;! - Action bar for background - Style & gt; & Lt; Style name = "myactionbar" parent = "@ Android: style / widget.Holo.actionbar" & gt; & Lt; Item name = "Android: Background" & gt; # 5477B1 & lt; / Item & gt; & Lt; / Style & gt;

Then enter the Application tag

  in your Android manifest.xmm < Mention it in the application. Android: Theme = "@ Style / Custom Action Theme"  

Good luck


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -