Application's name disappear Android - android

I made an Android application, but when I look at it in my device, the appName just disappeared whereas I added it in the manifest and strings.xml. My application is the one at the bottom left
manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package.package.package"
android:versionCode="3"
android:versionName="2">
<application
android:allowBackup="true"
android:icon="#drawable/countdown_icono"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
// Activities
</application>
strings.xml
<resources>
<string name="app_name">I can\'t wait!</string>
</resources>
If someone could helps :)
SOLUTION :
<activity
android:name=".MainActivity"
android:label="APP NAME" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

You probably need to add
android:label="#string/app_name"
inside your Activity tag in the AndroidManifest.xml.
<activity android:name=".theJavaClassActivity"
android:label="yourString">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Android Launcher shows the title of the activity that has the Intent-filter of android.intent.action.MAIN. In this way it is able to show more than one activity icons and titles if your application requires so.

Related

Android manifest merging: removing LAUNCHER intent-filter doesn't take effect

In my android app I use a library project and I use one of it's activities. However in the library project that activity has MAIN action and LAUNCHER category intent-filter. So I added that activity to my manifest and removed the intent-filter. The manifests seem to be correctly merged into build/intermediates/manifests/full/debug/AndroidManifest.xml, and the activity looks as expected (without the intent-filter):
<activity
android:name="com.michaelrnovak.util.logger.Logger"
android:configChanges="orientation"
android:label="#string/show_log" >
</activity>
However when I start the app from AndroidStudio in the emulator, then instead of my AlertsActivity, the library's Logger activity is launched. What am I doing wrong?
This is the manifest of the library:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.michaelrnovak.util.logger"
android:versionCode="8"
android:versionName="1.5">
<uses-permission android:name="android.permission.READ_LOGS" />
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity android:name=".Logger"
android:label="#string/app_name"
android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="7" />
</manifest>
and my app's manifest has the following relevant activity definitions:
<activity
android:name=".AlertsActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
</activity>
<activity android:name="com.michaelrnovak.util.logger.Logger"
android:label="#string/show_log"
android:configChanges="orientation"
tools:replace="android:label"
>
<intent-filter tools:node="removeAll" />
</activity>
Have you tried tools:node="remove" on the category node only? From my experience, it seems to work.
Something like this:
<activity android:name="com.michaelrnovak.util.logger.Logger"
android:label="#string/show_log"
android:configChanges="orientation"
tools:replace="android:label"
>
<intent-filter>
<category tools:node="remove" android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
I tried many ways on similar situation like you. I figured out that I must add tools:node="replace" in the Activity node to remove intent-filter's specific action and category. Try this :)
<activity
android:name="com.michaelrnovak.util.logger.Logger"
android:label="#string/show_log"
android:configChanges="orientation"
tools:replace="android:label"
tools:node="replace">
<!-- Rewrite the intent-filter you want -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Android: App name shows the first page name, not the app name

I changed the initial page in my app to be the "login" activity
but now I get the app name in my mobile called "login"
I checked #string/app_name it show "MyApp" yet the app name still "login" in my mobile
is there anyway to change the app name to "MyApp" without changing the login activity title?
here is my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.asmgx.myapp.app" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:name="com.asmgx.myapp.app.PubVar"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:debuggable="false">
<activity
android:name="com.asmgx.myapp.app.MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.asmgx.myapp.app.add_msg"
android:label="#string/title_activity_add_msg" >
</activity>
<activity
android:name="com.asmgx.myapp.app.ItemDetail"
android:label="#string/title_activity_item_detail" >
</activity>
<activity
android:name="com.asmgx.myapp.app.ListFilter"
android:label="#string/title_activity_list_filter" >
</activity>
<activity
android:name="com.asmgx.myapp.app.login"
android:label="#string/title_activity_login" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.asmgx.myapp.app.test1"
android:label="#string/title_activity_test1" >
</activity>
</application>
</manifest>
If your Launcher Activity does not have a label in its intent-filter attribute, its label value will be inherited from the parent component (either Activity or Application).
So you just have to add a label on your intent-filter, like this:
<activity
android:name="com.asmgx.myapp.app.login"
android:label="#string/title_activity_login" >
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This will apply your App name the #string/app_name value and give the Activity title the #string/title_activity_login value.
See the accepted answer from this post for more info.
change #string/title_activity_login to "MyApp"

Merging android manifest files, conflicting filter

I'm trying to combine android manifest files from 2 plugins in Unity, but there are two activities with the same intent-filter and I can only get 1 or the other to work at the same time....
Of the 2 conflicting activities, whichever is on top in the manifest file is the one that will work. So if activity from manifest #1 is on top, plugin #1 will work but not #2, and vice versa.
The two conflicting activities are:
<activity
android:name="com.devfo.andutils.DevfoUnityPlayerActivity"
android:label="#string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
And:
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity"
android:label="#string/app_name" android:screenOrientation="portrait"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
is there any way I can merge the two and get them to work from the same app? I'm using Unity 3d.
For example in the manifest where you want to use only the first activity as launcher you have to add this 2 modifications:
At the beginning of the manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
And for the activity for which you want to remove the intent filter add this code:
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity"
android:label="#string/app_name" android:screenOrientation="portrait"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter tools:node="removeAll">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
The important part is to add the tools:node="removeAll" attribute in the intent-filter tag
Declare your manifest header like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
And then add one of the following appropriate attributes to the relevant Activity(s):
tools:merge="override"
tools:merge="remove"
Slightly different to #amarkovits answer, I've found success with:
<activity android:name="com.qualcomm.QCARUnityPlayer.QCARPlayerProxyActivity"
android:label="#string/app_name" android:screenOrientation="portrait"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
tools:node="merge">
<intent-filter tools:node="remove"> ...
which I believe will try to merge it first, then replaces just the intent filter causing both Icons on the launcher screen
The Activity that has this intent-filter:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
is the main Activity that will start on application start up, you can't make both activities work at the same time.
what you should do is let only one Activity ( your main one have this filter) and leave the other one without it.
the second Activity will also be part of the application, but it will not be the first Activity you will see. You can start it by using the startActivity() method.
I have done this, the solution is that when you have multiple flavors, like
1. flavorA,
2. flavorB
and main application id is - com.android.vivek
and main flavorA is using com.android.vivek
and second flavorB is using com.android.vivek.flavorb
flavorA's manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.android.vivek">
<application xmlns:tools="http://schemas.android.com/tools"
android:allowBackup="true"
android:icon="#mipmap/flavorA_ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:icon" />
<activity
android:name=".ActivitySplash"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:node="replace">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
then simply flavorB's manifest mention like below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.android.vivek">
<application xmlns:tools="http://schemas.android.com/tools"
android:allowBackup="true"
android:icon="#mipmap/flavorB_ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:icon" />
<activity
android:name=".flavorB.SecondActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:node="replace">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActivitySplash"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait">
<intent-filter tools:node="remove">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
when you run flavorA or flavorB then it will work fine

Android launch icon doesn't work

I'm having problems with setting my launcher icon from my android app.
As you can see, i've named the logo logodoor.png in the folder drawable (too in drawable hdpi, ldpi, etc.), and in AndroidManifest.xml drawable/logodoor
When starting up the app, it won't show the right launch icon, but the standard no-icon-android-icon.
-> On the target device the icon isn't displayed good; like there is a logo for twitter too
thanks for your answer :)
Menno
Manifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.menno.ghlyceum" android:versionCode="1" android:versionName="1.0.4">
<uses-permission android:name="android.permission.INTERNET"/>
<application android:icon="#drawable/logodoor" android:label="Ghlyceum OB" android:theme="#android:style/Theme.Black.NoTitleBar" android:debuggable="false">
<activity android:name=".MainActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Notes" />
<activity android:name=".Help"></activity>
<activity android:name=".Rooster"></activity>
</application>
</manifest>
are you sure you have something like this:
<application
android:icon="#drawable/logodoor"
............>
</application>
<application
android:icon="#drawable/logodoor"
android:label="#string/app_name" >
<activity
android:name="YourActivityname"
android:label="#string/title_activity_flash_file" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
This way you can put your my launcher icon in manifest.
Sometimes I've had to uninstall the app for the icon to change
<application android:icon="#drawable/icon"
android:label="#string/app_name"

Android: No Launcher activity found! was working before

I have the same problem everyone reports but this began happening suddenly. My app was working as expected, automatically launching the MAIN activity.
But all of the sudden it stopped working and I started seeing the No Launcher activity found! message.
This is my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xitrica.android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="8" />
<application android:icon="#drawable/icon" android:label="#string/app_name"
android:theme="#style/Theme.Transparent">
<uses-library android:name="com.google.android.maps" android:required="true" />
<activity android:name="ElBusetonActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="andoid.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="RouteInfoActivity"></activity>
<activity android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:name="GetDirectionsActivity"></activity>
<activity android:theme="#android:style/Theme.Dialog"
android:name="PointProviderList"></activity>
</application>
</manifest>
Sorry if I'm not posting this snippet correctly. It's the first time I ever post a question.
Thanks in advance.
<activity android:name=".ElBusetonActivity" android:label="#string/app_name">
try this, prefix (".") on activity name
here (.) refer to package path
Remove
category android:name="android.intent.category.DEFAULT"
as it is not required.
Say if you have the Activity names TestActivity
If you want the TestActivity to be the first to launch when you hit "run", simply add two lines:
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
To the position like below in your AndroidManifest.xml:
<activity
android:name="TestActivity"
android:label="#string/name"
android:screenOrientation="portrait" >
<intent-filter android:label="#string/app_name" >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
use the dot before the activities in your manifest to declare it. or you can write the package name dot your activity name.
like this.........
<activity android:name=".ElBusetonActivity" android:label="#string/app_name">
if you not using package name then it decide the default one.

Categories

Resources