lundi 25 mai 2015

Android Change Action Bar menu text

i am new on android,i am getting in android action bar menu text is capital form but i want it to like Change#0333,like i described in the following example image,please how i can 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