tl;dr You can't change it because the icon of your app is registered in the Android Manifest that ships with it.
From the documentation:
Icons and labels
A number of manifest elements have an icon and label attributes for
displaying a small icon and a text label, respectively, to users for
the corresponding app component.
That means that your app will always have the same icon since the manifest cannot be changed in runtime. So my guess is that the app you reference is a system app, with system privileges.
The only icons that you can change are the shortcuts your app creates using this permission:
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
To create a shortcut, please check this answer: https://stackoverflow.com/a/40446734/1574250
To change the background when clicking in your app icon, here is an example (in this example I'm only changing the background color when the app opens):
Class:
public class YourActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set you app icon
setColorWallpaper();
// Finish the activity
finish();
}
/**
* Sets the color wallpaper to the color value in the Clipboard, or to a random color.
*/
private void setColorWallpaper() {
// Try to get the color parameter from the clipboard
Integer colorParam = null;
try {
colorParam = ColorClipboardParameter.getColor(getApplication());
} catch (Exception ignored) {
// An unexpected exception while trying to get the color code from the clipboard
// can crash the app at startup. Ignore any exceptions, we will generate a random
// color anyway.
}
// If there is no valid color value in the clipboard, generate a random color
final int color = (colorParam != null) ? colorParam : GoodRandomColor.nextColor();
try {
// Set the color wallpaper
ColorWallpaper.setColorWallpaper(this, color);
// Success: copy the color code to the clipboard
Utils.copyText(this, Utils.colorToHex(color));
// Go to the home screen
Utils.goHome(this);
} catch (IOException e) {
// Write the stack trace to System.err and copy the reason of the failure to clipboard
e.printStackTrace();
Utils.copyText(this, e.toString());
}
}
}
Manifest:
<application
android:fullBackupContent="true"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:installLocation="auto"
android:label="@string/app_name"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".YourActivity"
android:excludeFromRecents="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Check this project for more info: https://github.com/appgramming/LoneColor-Android