2
I was using to customize my menu items the actionLayout attribute but, the following error occurred:
Layout menu_item.xml:
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:focusable="true"
android:paddingTop="4dip"
android:paddingBottom="4dip"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:textAppearance="@android:attr/textAppearanceMedium"
style="@android:attr/actionButtonStyle"
android:textSize="6pt"
android:textColor="@android:color/white"/>
Isn’t it working? Yours
Activity
inherits from Actionbaractivity`.– Wakim
My activit inherits from Activity... I tried to inherit from Actionbaractivity but am not succeeding..
– Pedro Rangel
Is using the
appcompat
? TheActionBarActivity
is from the library ofapp compat
.– Wakim
I could import but of the error.. I am using in my Activity tabs to be able to select the Ragments this can give error? because when I was inheriting from Activity there was no error, just no menu...
– Pedro Rangel
i already found the bug.. was on android:actionLayout="@layout/menu_item" can’t use a menucustomized
– Pedro Rangel
Yes, just add an equal attribute without the prefix
android:
.– Wakim
i added the item with app:actionLayout="@layout/menu_item" but the xml error does not compile
– Pedro Rangel
It makes no sense, which error it generates?
– Wakim
I’ll take a print for you to see... I’ve looked in many forums and I didn’t see logic for this mistake.^^
– Pedro Rangel
@Pedrorangel noticed that you edited all your previous question to another. Since this is a new question, the ideal would be for you to create a new one and not edit this one, since the previous question may be doubt from other users, besides the comments here have been out of context with this edition.
– Paulo Rodrigues
@Paulorodrigues e pq when I asked a question, accidentally I put to grant reward... and had already solved... since it is not possible to return the points, I did not want to lose them and I asked another question^^
– Pedro Rangel
Pedro, I think you don’t miss when the time expires, it would be nice to see in the FAQ the rule. But as @Paulorodrigues said, it’s best to create a new question, because everything that was written before has lost its meaning.
– Wakim
blz...@Wakim and @Paulorodrigues thanks for the tip from you guys, sorry anything^^
– Pedro Rangel