Android, icon been duplicate when i install my app on the device - android

I try to install the app that i develop on my device (Htc desire) and i see that the icon of the app is duplicate
what i need to change to don't late that happen?
how could i delete one of the icon?
Thanks for helping!!

I came up this issue today, I am using Gradle.
I found out there was a folder ./build/manifests/debug/AndroidManifest.xml was generated from gradle build, and it had duplicate intent-filter of category launcher.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
...
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
One of it was came by gradle dependencies compile project. So I went back and check dependencies project and remove it, and the problem solved.

Android's Launcher app creates an icon for each Activity in your Application that includes the intent filter android.intent.category.LAUNCHER.
Remove this intent filter from all Activities that should not be launched. In other words, define this intent filter in your main Activity, and in your main Activity only.

for change icon of app..
<application android:icon="#drawable/icon" android:label="#string/app_name">
see this line in your menifest file.. and change "#drawable/your_icon_name" instead of "#drawable/icon"

do you use the default icone of android , or u have change the app's icon from the manifest ?
if that's right , try using the default icon of android , and then see if that will duplicate the app's icon or not

try to use this ,
<intent-filter>
<action android:name="android.intent.action.(your action )" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
and you have to use ur main activity
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
let me comments if any issue.

force stop your launcher from settings - app manager and clear cash data of launcher and check your problem is resolved

Related

Multi icon in screen Android [duplicate]

I am writing an Android App that has one main activity and one subactivity. When I install the app on my phone to test it out, I get two icons instead of one. The first icon is for the main activity and the second is for the subactivity. I don't want/need an icon for the subactivity.
Does anyone know how to turn this off in my app code, so that only the icon for the main activity is installed? Any information you can provide is greatly appreciated!
Thanks,
MobiKnow
Does your application manifest list an intent filter under your sub-activity that matches the main launcher?
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Make sure that your sub-activity is not filtering for these intents.
Edit: Just to be very clear, make sure the above lines are not listed under your sub-activity. That intent filter lets the Android system know that you intend for it to be listed as an entry point to your application.
We have the same problem but i fixed it this way
before my code below in manifest
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Notice that in the SplashActivity inside the intent is this code
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
i only deleted the category
<category android:name="android.intent.category.LAUNCHER" />
So after i deleted the intent-filter category in splash it didn't install two app icon but only one for main the code will be like this notice that the intent-filter category is deleted
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
it really helps
It creates two App icon because you must have added the given filter to two of your activities. See manifest.
<category android:name="android.intent.category.MAIN" />
Remove the above statement from the other one. Then you are good to go.
Like in the other answers,
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
Was the culprit. However, in my manifest I only had one activity with that intent filter. As it turns out, I am using a library I built and it has an activity declared in it's manifest which uses that intent filter. So, in short, be sure your app's manifest and dependencies, if any, only have one activity with the intent filter.
I guess that in your AndroidManifest.xml, you've got both activities having the LAUNCHER intent-filter. Remove it from the second activity, and you should be set!
You have
<intent-filter . . . >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
along with
android:icon="#drawable/icon.png"
set for both activities.
What that means is that this is a launcher icon, put me on the home screen. Only set those for the activit(ies/y) you want on the home screen.
I was searching answer to exactly the same question. It appears the only thing needed (in addition to recommendations on removing MAIN and LAUNCHER intent filter) is to rebuild your project - that will clean things up and upon next launch I saw single icon on my device (just running application on device after changes did not help).
if anyone run into this issue using Pebble SDK. I noticed PebbleKit Androidmanifest.xml holds a LAUNCHER activity as well. This is what caused it for me. Just remove this part. It will not effect Pebble functionality.
SIMPLE answer..
REMOVE:
<category android:name="android.intent.category.LAUNCHER" />
From your AndroidManifest.xml
Leave your intent-filter alone.
<intent-filter android:icon=”drawable resource” android:priority=”Integer” /intent-filter>
Priorities are set for the parent component. This setting may help you to set the parent icon for your Android app development.

Application icon does not appear after installing android app

I am developing an android app and when I install the app on android phone, the application icon does not appears in application section. But it appears in application manager and I can make uninstallation. After googling, some said I need to rebuild my project and to make sure the app icon in drawable resource. I already tried for this solution and the problem is still occurring. The manifest file I created is as follow:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".MyActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.view" />
<data android:scheme="geo" />
</intent-filter>
</activity>
</application>
I believe geo scheme cannot be used with Launcher. I can't find any documentation but in this tutorial they suggest to use with default category.
Please try to move your location related code to another activity and move scheme=geo filter to that one.
In your manifest in activity try using or add another intent filter
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
`
Change
android:icon="#drawable/ic_launcher"
With your icon
if you wanna to remove this icon you have to remove from all folder like
drawable
drawable-hdpi
drawable-mdpi
drawable-xhdpi
I set action android:name="android.intent.action.MAIN and android:name="android.intent.category.LAUNCHER two of mine activity intent.For this I'm having two launcher icon.When I noticed that I remove one activity's intent filter,but My launcher icon disappear.I tried all the mentioned above solution but didn't work.As I noticed Darpan's comment about re-starting your phone will fix it I tried and It works for me
In my case, my manifest included a label for the main activity. I deleted the label, restarted the app and the icon magically appeared in the applications list.

In android every .java file becomes an app on the phone!

I have 6 .java files under one package.In eclipse, after I export the .apk and install the app on the phone or if i run the app on the emulator, there are 6 applications created, one for each .java file! The java files are different screens in my app.So i can open any java file by clicking on the icon in the menu.I only want one of them to be openable through the icon in the menu. So basically, only one icon should be seen in the main menu, which upon clicking opens the first activity in the manifest file!
Any idea whats wrong?
Thanks.
My assumption:
You registered all your Activities in the AndroidManifest (which is right) but as intent-filter you always used
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
That intent-filter tells Android to add the Activity to the launcher. Remove those Intent-filters (except one Activity that's going to be your main entry point) and it should work.
What does your manifest say? It might specify that all activities are shown as seperate apps...
Just check your AndroidManifest.xml file and modify your activity same as below code example:
<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=".SecondActivity"
android:label="SecondActivity">
</activity>
So if you mark the above code then you can easily come to know that the below code mention that this activity is going to be act as a launcher activity.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Try to mention the intent-filter action as MAIN and Category as Launcher only for your entry activity in your app.
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
</intent-filter>.
Remove this for all other activities except the entry point for your app.
Hope this helps.

Android App Development: Two icons getting created and I only need one

I am writing an Android App that has one main activity and one subactivity. When I install the app on my phone to test it out, I get two icons instead of one. The first icon is for the main activity and the second is for the subactivity. I don't want/need an icon for the subactivity.
Does anyone know how to turn this off in my app code, so that only the icon for the main activity is installed? Any information you can provide is greatly appreciated!
Thanks,
MobiKnow
Does your application manifest list an intent filter under your sub-activity that matches the main launcher?
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Make sure that your sub-activity is not filtering for these intents.
Edit: Just to be very clear, make sure the above lines are not listed under your sub-activity. That intent filter lets the Android system know that you intend for it to be listed as an entry point to your application.
We have the same problem but i fixed it this way
before my code below in manifest
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Notice that in the SplashActivity inside the intent is this code
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
i only deleted the category
<category android:name="android.intent.category.LAUNCHER" />
So after i deleted the intent-filter category in splash it didn't install two app icon but only one for main the code will be like this notice that the intent-filter category is deleted
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
it really helps
It creates two App icon because you must have added the given filter to two of your activities. See manifest.
<category android:name="android.intent.category.MAIN" />
Remove the above statement from the other one. Then you are good to go.
Like in the other answers,
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
Was the culprit. However, in my manifest I only had one activity with that intent filter. As it turns out, I am using a library I built and it has an activity declared in it's manifest which uses that intent filter. So, in short, be sure your app's manifest and dependencies, if any, only have one activity with the intent filter.
I guess that in your AndroidManifest.xml, you've got both activities having the LAUNCHER intent-filter. Remove it from the second activity, and you should be set!
You have
<intent-filter . . . >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
along with
android:icon="#drawable/icon.png"
set for both activities.
What that means is that this is a launcher icon, put me on the home screen. Only set those for the activit(ies/y) you want on the home screen.
I was searching answer to exactly the same question. It appears the only thing needed (in addition to recommendations on removing MAIN and LAUNCHER intent filter) is to rebuild your project - that will clean things up and upon next launch I saw single icon on my device (just running application on device after changes did not help).
if anyone run into this issue using Pebble SDK. I noticed PebbleKit Androidmanifest.xml holds a LAUNCHER activity as well. This is what caused it for me. Just remove this part. It will not effect Pebble functionality.
SIMPLE answer..
REMOVE:
<category android:name="android.intent.category.LAUNCHER" />
From your AndroidManifest.xml
Leave your intent-filter alone.
<intent-filter android:icon=”drawable resource” android:priority=”Integer” /intent-filter>
Priorities are set for the parent component. This setting may help you to set the parent icon for your Android app development.

Android: APK Icon is not being installed

I am able to deploy my application but for some reason, I am not able to get the icon to display in the pull up menu on the Home page of the OS. Does anyone know what I can do to solve this?
By the way, the application shows up in "Manage Applications" but does not show up as an icon for some reason. Through Eclipse, I am able to start the application after deployment but that's it... After that, I don't have any way to start it because there is no icon. :( Following is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.ApplicationName"
android:versionCode="1"
android:versionName="2.0">
<application android:icon="#drawable/icon"
android:debuggable="true"
android:label="#string/app_name">
<activity android:name=".EntrySplash"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="com.android.ApplicationName"></data>
</intent-filter>
</activity>
<activity android:name=".EntryScreen" android:label="#string/app_name">
</activity>
<activity android:name=".ApplicationName" android:label="#string/app_name">
</activity>
</application>
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
I had this problem as well, i think the fix that worked for me is i separated the intent tag like below
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="com.android.ApplicationName"></data>
</intent-filter>
when i changed my manifest file like that, my icon showed up.
Try getting rid of your android.intent.category.BROWSABLE and <data android:scheme="com.android.ApplicationName"> temporarily, and see if your icon shows up.
Also, on an unrelated matter, I recommend that your uses-* elements be the first children of manifest, not the last. There have been rumors of problems with the XML parsing done by the Android Market, where it wants to see those before any elements.
Had this same issue and found out that one caveat is that this correct intent on the main activity tag:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
has to be in its own intent filter. you may have other items in the main activity's intent filters, and if so, separate the rest out in to a separate intent filter tag right below it. leave the MAIN and LAUNCHER together in its own.
Alot of the answers to this question on SO seem to miss that point.
Hope it helps!
Well it is happening as you are giving two categories name to your launching activity. You launching activity should have only one category name in its Intent filter. But if you also need the Browsable activity then your Launching Activity may have 2 Intent Filters as show below.
You just replace your EntrySplash Activity code with the below code in you Manifest.xml file.
<activity android:name=".EntrySplash"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="com.android.ApplicationName"></data>
</intent-filter>
</activity>
This will sure work for you...
This problem still exists in SDK v2.2. A few more suggestions in addition to the ones above if you want to publish to your phone from Eclipse. Try these if it's still not working and you don't feel like manually publishing. Remove all blank lines in the manifest. And make sure this line just has only icon and label properties in it:
<application android:icon="#drawable/icon" android:label="#string/app_name">
Apparently I found out that it works if I manually install the application using command line adb. So, in case you updated your ADT plugin and you experience problems, just install things manually...
I find that sometimes my assets don't update in the app when I add them to my projects.
There are two ways you can fix this problem:
Clean and rebuild the project.
Uninstall the app on your phone and install it from scratch using ADT.
Simple as that!
Just to add confirmation to CommonsWare's answer, I just came across this exact bug for a project targeting 2.3.3+. I had to Delete the following:
<data android:scheme="com.android.ApplicationName"></data>
Then I had to Clean the project. I think that having to use adb to install every time is a sign of something wrong with the Manifest, and will come back to bite you later (once in the Market specificially).

Categories

Resources