How to change android Activity label

noname picture noname · Apr 13, 2012 · Viewed 50.9k times · Source

I have created an Activity and declared in Manifest file. But I would like to re-use the same Activity for other purpose.

 <activity
            android:configChanges="orientation|keyboardHidden"
            android:label="Main Menu"
            android:name=".MainMenu"
            android:theme="@android:style/Theme.Light" >
        </activity>

I need to change the Label dynamically. Thanks in Advance

Answer

Shubhayu picture Shubhayu · Apr 13, 2012

Use

setTitle(int titleId)

or

setTitle(CharSequence title)