mardi 26 mai 2015

Android Change Action Bar menu text

I am new at Android, I am getting in Android action bar menu text is capital form but I want the text Change#0333 like I described in the following example image. Please how can I achieve this? Thanks.

enter image description here

This is my Code:

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);

    menu.getItem(0).setTitle("change#0" + defaultmsisdn.substring(2));

    return true;
}

And this is my main.xml file in res/menu folder:

<menu xmlns:android="http://ift.tt/nIICcg"
xmlns:app="http://ift.tt/GEGVYd"
xmlns:tools="http://ift.tt/LrGmb4"
tools:context="com.ufoneselfcare.MainActivity" >

<item
    android:id="@+id/change_number_menu"
    android:orderInCategory="100"
    android:title="@string/action_settings"
    app:showAsAction="always|withText"/>

</menu>

Aucun commentaire:

Enregistrer un commentaire