Reputation: 2263
Firstly, I copied some icon to mipmap
(named ic_launcher.png) - Didn't work.
Second I right clicked res>new>image asset
- Didn't work too.
My manifest.xml code is as.
<application
android:name=".BlogI"
android:allowBackup="true"
android:icon="@mipmap/applicationicon" // This even shows the right icon in right corner along with the line numbers
android:label="@string/app_name"
......
......
I tried clean project and rerun, restarted my android studio(even my PC) also restarted my android device. But, none of the above worked. Before asking this question I tried other similar questions but none helped. Like this one.
If there are any alternatives them please do suggest ! Thanks!
Upvotes: 1
Views: 4933
Reputation: 6282
When you generate image asset, delete ic_launcher.xml
but keep the png
files. xml file has ic_launcher_foreground attribute that overrides default android launcher icon.
Upvotes: 4
Reputation: 1
Finally found the mistake I was doing from long time.
Just make sure that in AndroidMainfest.xml
you have set both properties - android:icon
and android:roundIcon
appropriately
<application
android:icon="@mipmap/app_icon"
android:roundIcon="@mipmap/app_icon".../>
I was just setting android:icon
and kept android:roundIcon
unchanged.
Upvotes: -1
Reputation: 2263
I finally found out the fix! It was my 3rd party launcher (Evie Launcher)
that didn't update the icons. The icons worked fine on all the devices here on including mine after I changed my launcher.
Thanks for all the suggestions and answers.
Upvotes: 1
Reputation: 11
First paste your image in drawable
then add following code in manifest.xml
<application
android:name=".BlogI"
android:allowBackup="true"
android:icon="@drawable/your_Image"
android:label="@string/app_name">`
It worked for me.
Upvotes: 1