'How to Remove white Background from icon?
I have an app on android that create home shortcut icon. The image of the icon is image that i set programmatically from the drawable
Now the problem is, when the shortcut was created on the home screen it's created with white background.
How do i remove that white backgroubd and set image to full size of icon?
Thank you all..
EDIT: the app i was talking about is app that i developed using android studio and just want to set full size of image when i create home shortcut
Solution 1:[1]
This is highly dependent on the launcher you use. The image looks like the standard google android 8+ (?) icon shape. I theory it could be part of the icon you created but since you are asking this I doubt it.
In older versions of android the outer shape of the icons were individual, while rather cool and the outline correctly shown while dragging them etc many complained about the lack of a uniform look of all the icons in the app drawer etc.
It was introduced to make all icons seem more uniform. Long pressing an empty space in the Google Pixel launcher for example shows a choice to go into the settings for the launcher and there you can change the shape all icons should have:
In addition to this, apps can take advantage of the various shapes and adapt to them and fill them out so to speak. See for example the Chrome icon while changing the icon shapes in the launcher settings.
Introduced in android 8: The feature is called adaptive icons.
See the docs about adaptive icons here: https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
Solution 2:[2]
That is because of adaptive icons - a feature of Android 8 and can't or shouldn't be changed. You can at best change the colour of the background.
Solution 3:[3]
i removed the white background from the launcher icon by following these guidelines https://developer.android.com/studio/write/image-asset-studio
a few more points
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Stef |
| Solution 3 | user3267567 |


