app launcher icon changed to default icon on Oreo - android

I have created an Android app with its own launcher icon. It worked well with Nougat. But with Oreo, my icon is replaced by the default Android icon.
I have defined ic_launcher.png and ic_launcher_round.png in the mipmap resources for several densities.
My manifest contains the following line:
android:roundIcon="#mipmap/ic_launcher_round"
What should I do to make my own icon appear on Oreo ?

For API 26+ default Android application template defines another icon resource folder
mipmap-anydpi-v26
That folder (usually) contains two xml files ic_launcher and ic_launcher_round that match icon resources declared in manifest for API 26+
Content of those files looks like following:
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="#drawable/ic_launcher_background"/>
<foreground android:drawable="#drawable/ic_launcher_foreground"/>
</adaptive-icon>
In order to have your icon you also need to change all drawables (in all density buckets) listed there - namely ic_launcher_background and ic_launcher_foreground
Or you can just delete that folder, in which case android will fallback to using your png icons, but they will not appear as-is and will be commonly drawn on top of white background.
You can read more at: Adaptive icons

Best solution is delete mipmap-anydpi-v26 folder then app will take default icon. In android studio Project mode go to this package
res/mipmap-anydpi-v26
delete it and rebuild and Run Project.

My solution:
check res/mipmap-anydpi-v26 folder, then you will see ic_launcher.xml and ic_launcher_round.xml files
edit these xml files to point to the actual png file you want to use:
If such png file is not available inside the drawable folder, add it.
That solves the issue.

Related

Adaptive icons not working in Oreo - why?

I'm trying to add a custom icon from an SVG file to my Android app by right-clicking on the res folder -> new -> Image asset. I have selected the default options, using my SVG but I can't see the icon when I'm running the app.
I have tried to do a clean project before installing it and also an invalidate cache and restart and the result is the same.
I've also realized that mipmap-anydpi-v26/ic_launcher.xml shows the default icon I'm seeing when my app is installed. This file contains:
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="#drawable/ic_launcher_background"/>
<foreground android:drawable="#drawable/ic_launcher_foreground"/>
</adaptive-icon>
when clicking on the #drawable/ic_launcher_foreground I get to locations to open: drawable and drawable-24. The first one shows my recently updated icon, but drawable-24 shows the default Android icon I see when installing my app.
Is there anything I'm missing here? Anything else I have to do?
Thanks!
drawable-24 folder has higher priority than drawable.
Api-specific resources, along with resolution-specific and language-specific are always more preferrable by Android than unspecified resources.
Well, in the end, I just created the icons from a PNG instead an SVG and it works great.

Android app icon is default icon on homescreen

I cannot update the icon on the homescreen. It is the green robot default android icon. How can I change this to the icon?
I have added icons in the app > src > res folder for different resolutions.
I am uploaing my app using the play console. Any ideas?
My manifest states:
android:icon="#mipmap/ic_launcher"
The name matches the image in the assets folders.
Here is a link to my repo:
https://bitbucket.org/matthisco/ejected-calendar/src/master/android/app/src/main/
Change project to android
than go to res>mipmap>paste your icon there (iconName.png)
replace
android:icon="#mipmap/ic_launcher" in manifest
to
android:icon="#mipmap/iconName"
You can update the homescreen icon as follows:
In AndroidManifest.xml under application tag
<application
android:icon="#mipmap/yourdesiredIcon"/> // replace ic_launcher to desired icon
Goto app > src > main > res
rename your icon to ic_launcher.png and paste it to all mipmap folders
The correct folder where the Android icon must be placed is res->mipmap-xxxx where xxxx signals the screen resolution.
Also check that your manifiest is using it. Open the manifest and in the application tag you should have something like this:
android:icon="#mipmap/ic_launcher"
Also verify you icon is named ic_launcher.
As you can see that entry in the manifest says "go look for the icon in the mipmap folder, use the one named ic_launcher"
I faced the same issue, but I realized that in the Android Manifest
android:roundIcon="#mipmap/ic_launcher"
android:icon="#mipmap/ic_launcher"
were pointing to the same images, which were square. The phone I was testing on had a round icon, and so the default android image was displaying, I presume because the format was incorrect.
When I then tested on a phone with a square image, the images were displaying correctly.

Cannot change launcher icon android

I am trying to change launcher icon for the application I am developing but the icon remains same (Android Studio 3.0). I have tried changing it from manifest.xml and minimap. It appears to be picking up icon from two XML files named as ic_launcher_background.xml and ic_launcher_forground.xml. I have tried deleting these files but safe delete is not allowing me to. I am attaching screenshot of my project.
enter image description here
try to move your your ic_launcher_torch icon into mipmap directory
Remove the ic_launcher_torch.png file from drawables folder.
Right click on res folder> New Image Asset > Icon type > Action Bar and Tab Icons > Asset type - image > Choose your logo in path > finish.
Add android:icon="#mipmap/yourLogoName"
The image will be saved in /res/drawable folder. Learn more: https://developer.android.com/studio/write/image-asset-studio.html
Copy & paste launcher icon .png file to mipmap folder. Better if you add icon to all screen types hdpi, mdpi, xhdpi & etc. Then change android manifest code like this.
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
make changes in manifest file at both location
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
First uninstall the app from the phone(dont reinstall when you already have it installed)
After the app is uninstalled ,try installing it once again .
I had the same issue ,wasted around 2 hrs and this worked for me

How to change icon app only in application manager android?

Is it possible to change the icon of my android application only in the applications manager (Settings->manage applications) to be something other than the app icon (Launcher)?
I use android:icon in the AndroidManifest but it changes the twice. I honestly can't find any answer to this.
By Settings->manage applications, if you mean Device Setting Account manager icon, then in your application res folder you can find xml folder, from the xml file on that folder you need to change your icon.
For example --
<account-authenticator
xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="#string/auth_type"
android:icon="#drawable/ic_contest_icon"
android:label="#string/app_name"
android:smallIcon="#drawable/ic_contest_icon" />
you need to put your icon id from drawable on android:icon="#drawable/ic_contest_icon"
and android:smallIcon="#drawable/ic_contest_icon"

To change navigation drawer title icon image in Android

I have downloaded a Android Navigation drawer sample project and trying to use that. At the initial state, i don't know how to change the navigation drawer title icon to different icon image. where exactly is this image located specifically? Is it under any specific Res->drawable folder? Please find the screenshot, where I rounded the navigation title icon image, which I want to change now.
You can change it in your AndroidManifest.xml, put your icon in your res/drawable folder and set the "logo" param to your icon like this:
<manifest>
...
<application
...
android:logo="#drawable/your_image_file_name">
</application>
...
</manifest>
You can find it being set in your manifest. It automatically accesses #drawable/ic_launcher as your app icon
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Byustudiestab" >
You should change your app icon in AndroidManifest.xml
android:icon="#drawable/ic_launcher"
where exactly is this image located specifically? Is it under any specific Res->drawable folder?
To find where the image is located in eclipse, do the following: res -> drawable
Also the image might be locate in either drawable-hdpi, drawable-ldpi, drawable-xhdpi, drawable-xxhdpi
Once you find the image location, replace the image with an image of your choice. Either give the image a new name or keep it the same name as the old image. If you decide to give the image a new name you will have to head on over to the AndroidManifest.xml and replace the old name given to the old image with the new name that you gave the new image.
android:logo="#drawable/your_image_file_name"
Another option:
getSupportActionBar().setLogo(R.drawable.yourImage);
or
getActionBar().setLogo(R.drawable.yourImage);
Note: Attribute "logo" is only used in API level 11 and higher android:logo requires api (if you don't use getSupportActionBar)

Categories

Resources