2017-11-08 2 views
0

Ich versuche, einen anderen App-Namen für eine Aktivität "Mein Profil Foto" zu haben, aber es scheint nicht angezeigt werden, auch wenn ich habe android:label="My Profile Pic" auf die jeweilige Aktivität gegeben die Manifest-Datei:Android Studio Android: Label für eine andere Aktivität zeigt nicht den App-Namen [funktioniert nicht]

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.example.aditya.myprofile"> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 

    android:roundIcon="@mipmap/ic_launcher_round" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 
    <activity android:name=".MainActivity" 
     android:label="My Profile"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name=".ProfilePhoto" 
     android:label="Profile Pic" ></activity> 
</application> 

</manifest> 

Der XML-Entwurf:

Die Android App-Name Raum ist leer

image

Wohin gehe ich falsch?

+0

Mögliche Duplikat von [Wie Sie den Text auf der Aktionsleiste ändern] (https://stackoverflow.com/questions/3438276/How-to-Change-the-Text-on-the-Action-Bar) – guisantogui

Antwort

0

Versuchen Sie, diese hinzufügen Titel durch Java-Code fügen Sie diesen Code in Ihre Aktivitäten wie diese

getSupportActionBar().setTitle("My Profile"); 
+0

Irgendwelche Kotlin Unterstützung für den gleichen Code? – Tegr4

+0

@ Tegr4 überprüfen Sie diesen Link kann es https helfen: https://github.com/Kotlin/anko/issues/198 –

-1

Ich glaube, Sie ein Thema zu Ihrer Tätigkeit in Ihrem Manifest festlegen müssen.

<activity android:name=".ProfilePhoto" 
    android:theme="@style/AppTheme" 
    android:label="Profile Pic" ></activity> 

Eine andere Lösung: in Ihre Aktivität in onCreate müssen Sie rufen:

getSupportActionBar().setTitle("Your Activity Title"); 
+0

Versucht das XML geschnitten, funktioniert nicht. – Tegr4

Verwandte Themen