I have created an Activity and declared in Manifest file. But I would like to re-use the same Activity for other purpose.
Use
setTitle(int titleId)
or
setTitle(CharSequence title)
Static, not Dynamic
Go to your AndroidManifest.xml file and add the android:label attribute to the activity tag you want, like this:
<activity android:name=".name" android:label="label"/>
if(Condition)
{
setTitle("Your Title");
}
else
{
// your Default Title from Manifest
}
Try to use this line.
User this
@Override
public void onCreate(Bundle savedInstanceState) {
setTitle("Your Title");
}