Ryan Rao Ryan Rao - 7 days ago 6
C# Question

Xamarin.Android: Problems changing the application icon from the default icon

I just started learning how to develop for Android a few days ago, so I'm still in the process of learning all the ins and out of the environment. Recently, I finished writing the functionality for a basic Contacts app and decided to turn to fixing some of the finer points of the UI. I have been trying for the last couple of days to change the launcher icon for the app from the default Android icon Default Icon to one that I selected Selected Icon. However, nothing I seem to try will allow the icon I selected to appear on the device I am testing on.

I added what is supposed to be the proper line in the Android Manifest file as seen here:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="Contact_Manager.Contact_Manager" android:versionCode="1" android:versionName="1.0" android:installLocation="internalOnly">
<uses-sdk android:minSdkVersion="16" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application android:label="Contacts" android:icon ="@drawable/contacts-3"></application></manifest>


But this solution did not work. I also tried deleting the default icon from the drawable folder(I also saved a copy of it elsewhere) but it still showed the default Icon on the device screen. I then tried to uninstall the application on the device in order to clear all the cache files, but was met with the same outcome. Is there something I'm doing wrong?

Note: I am also new to StackOverFlow so I apologize if the formatting of this question is awful.

Answer

I suspect you have not deleted all the versions of default icon. In android there is a icon for each screen density in drawable-mdpi, drawable-hdpi, etc folder. Hence search for that file and remove it from all the folders and try again.

You need to add fresh icons for each density.

UPDATE 1 :

I think I know the problem now. Right click the project on solution explorer. Then click on options. Then Build-Android Application.

Change the application icon there.