Reputation: 69
I have added an empty activity in option menu settings. When I am clicking on settings an activity opens, named My Application, which is my application name. I want the name to be Settings. Can anyone help? I'm using Android studio.
Upvotes: 3
Views: 12804
Reputation: 722
AndroidManifest.xml
android:label="Settings"
to activity tag.<activity
android:name=".SettingsActivity"
android:label="@string/settings_label"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" />
Upvotes: 1
Reputation: 2985
Select the activity name in the project explorer and press "Shift + F6" (in windows) or "CMD + F6" (in mac). A dialog will come, give new name to that activity and press OK. This will make changes in all the required places.
Upvotes: 0
Reputation: 767
set your activity title using this code:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("My title");
Upvotes: 1
Reputation: 601
Click on the activity file from the project structure. Press "Shift + F6 ", you will be asked to rename the activity. Enter the new name and press Enter. Hope this helps.
Upvotes: 2