There is one MainActivity , he has a label="ПРОГА" .
The name of the application is "Android". It is necessary to make sure that the text of the given program "Android" is displayed in Launchere , and when you start the text in the MainActivity in the ActionBar there was the "Prog".

  <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="LikeMobile" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:windowSoftInputMode="adjustPan" android:label="СОВЕТЫ" android:icon="@drawable/ic_advice"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".Data"/> <activity android:name=".Settings"/> </application> 

picture

Closed due to the fact that the essence of the question is incomprehensible by the participants of Suvitruf , ThisMan , sercxjo , aleksandr barakin , Max Mikheyenko Nov 8 '15 at 1:44 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • <application> is essentially your application. You kind of say in the Manifesto: "I want my application to have an @ mipmap / ic_launcher icon and called @ string / app_name." What works here incorrectly? Specify the question please. - Shwarz Andrei
  • @ShwarzAndrei, That's exactly what the logic does, but actually, if <activity MainActivity add a label and icon to <activity MainActivity , then everything that is <application will be ignored. Both the text and the icon specified in <activity MainActivity will be displayed both in the Launchere and in the application itself - Andro
  • @xTIGRx Theoretically, an application cannot be shown. All you see on the screen is activity . And each activity has its own icon and name. If you do not set these parameters for <activity> , the parameters from the <application> tag will be used. - Daniel Shatz
  • Damn, do you even understand what it is about?)), It feels like you specifically write it all). I speak in LAUNCHERE. Tobish in the android in the place where all the programs are visible. There my program is displayed with a different name. WHICH is specified in <activity and this is not correct) - Andro
  • @DanielShatz, Exactly what is not :). it says android:label="LikeMobile" - Andro

3 answers 3

In the launcher, all activities are displayed, and, accordingly, their parameters are taken from the activity tag in the manifest. Change the label and icon for the activity tag - these parameters will be passed to the Activity itself .

If you add a label in the intent filter , this label will be displayed in the launcher . In your case like this:

 <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="LikeMobile" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:windowSoftInputMode="adjustPan" android:label="СОВЕТЫ" android:icon="@drawable/ic_advice"> <intent-filter android:label="LikeMobile"> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".Data"/> <activity android:name=".Settings"/> </application> 
  • Then, in the MainActivity, there will already be a text LikeMobile, which is not correct, the text “Tips” should be in the ActionBar in the MainActivity - Andro
  • @xTIGRx take a look now - Daniel Shatz
  • Yes, what you need) - Andro

Thank you for clarifying the question.

In your case, the situation is as follows:

in the application element you specified:

 android:icon="@mipmap/ic_launcher" android:label="@string/app_name" 

Then icon and label are used by default, in all! application components.

But changes to the MainActivity.class icon or label values ​​will change the icon or label in the Launcher. Because:

  <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> 

You configured Activity as Launcher. Those changing the icon or label you are distributing this value to Intent. In fact, you chose this activation as the Launcher tool and the output is simple that the labels and icon specified in the filter will be displayed in the launcher.

    I do not understand what the problem is.

    There is an application label , there is an activity label .

    If no label specified for the Activity , then the one that is specified in the application part is used. The priority of icon and label attributes for activity greater than in application .

    PS Any text in ActionBar can be set:

     setTitle("My new title"); getActionBar().setIcon(R.drawable.my_icon); 
    • Maybe there is a way to change the priority? There is one MainActivity, he has the label "PROG". The name of the application is "Android". It is necessary to do so that the text of this program "Android" is displayed in Launchere, and when you start the Text in the MainActivity in the ActionBar there was the "Prog" - Andro
    • The priority is given by the specification. I don’t think it is possible to do something about it. And in the ActionBar text can be any. setTitle ("My new title"); getActionBar (). setIcon (R.drawable.my_icon); - Suvitruf