Creating a shortcut: how can I work with a drawable as Icon?

前端 未结 2 1645
半阙折子戏
半阙折子戏 2021-02-06 10:54

Below is My code to create a shortcut to a selected application. I have really no problem and the application work quite well.

The problem is that I am able to create a

2条回答
  •  梦如初夏
    2021-02-06 11:01

    I can't comment since I have only 23 reputation, but I used your code and it was usefull. But my image didn't scaled correctly on the shortcut, so I found two interesting topics that can complete the solution:

    To get the correct size for a shortcut icon: https://stackoverflow.com/a/19003905/3741926

    To scale your drawable (using the size you calculated with the previous function) https://stackoverflow.com/a/10703256/3741926

    With all that I got a shortcut with a correctly scaled icon, hope it will help

提交回复
热议问题