Search code examples
androidiconsandroid-manifestlaunch

Can I set android launcher icon in Main Activity


We always know set android:icon in Manifest can set icon and logo,

android:icon="drawable resource"

Can I set logo icon in Main Activity with Java code?

thanks for help


Solution

  • This answer could help you. Extract from mike yaworski's answer:

    Summary:

    android:icon="@drawable/ic_launcher" determines your launcher icon, so just add images to the drawable folders and change ic_launcher to whatever the name of image is that you want to be the icon.

    android:label="@string/app_name" determines your "label" so just look for app_name (because the label is referenced to @string/app_name) in your strings.xml file and change the contents of app_name.