Sometimes when we create an activity in Android we don't put appropriate title of activity or may be later on we want to change the activity title. So how can we change it? Let see -
There are two ways to do this.
1. Using Java code
2. Change in XML file
Using Java code-
setTitle("Your Title");
put this code in activity Java coding page, like-
There are two ways to do this.
1. Using Java code
2. Change in XML file
Using Java code-
setTitle("Your Title");
put this code in activity Java coding page, like-
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle("Your Title");
Another way to do this is to change in AndroidManifest.xml file of your project. See the screen shot to locate AndroidManifest.xml
You can see your activity in this file under <application></application> tag. You just have to change/enter the label of your activity.
android:label="Your Title"
See bellow-
<activity android:name=".Your_Activity" android:label="Your Title"> </activity>
No comments:
Post a Comment