I know that we can set it through manifest file using android:icon attribute.But how can we set it in java code?
It doesn't make sense to set it programmatically, the launcher has to display the application icon when the application isn't active.
If you take a look at How to change an application icon programmatically in Android?, you will find a comment, which links to this sample code in the Android developer API demos: LaucherShortcuts.
It seams that the Activity can create a LauncherShortcut, which can have a different icon (see function setupShortcut()). If you want the user to select the Icon, you have to display a list of icons when creating the shortcut. But again, it is a shortcut. In the list of application the original icon appears.
I dont think the launcher icon can be set programatically.
Related
On my phone "desktop" I can see the custom icon I have set up for my app (by placing the images inside the mipmap folders and referencing them inside AndroidManifest).
However when I click the overview button, I still see the default flutter icon associated with my app.
How can I change that?
I Suggest flutter_launcher_icons package for changing Flutter application icon.
As you have to define an icon for different resolutions.
But when using flutter_launcher_icons , you just define/update your icon app once.it's easy to use just follow the guide :
https://pub.dev/packages/flutter_launcher_icons#book-guide
Is there any way that the user can choose the application name and launcher icon of my app and set it programmatically?
I want to give the permission to user so that he can rename my application and also change the launcher icon of the app.
Is there any solution to this?
The only thing you can do is to define multiple Launcher Activities with pre-defined icons and labels, and enable/disable them programmatically.
setComponentEnabledSetting (ComponentName componentName, int newState, int flags)
It is not possible to change either of these values easily. You could create new Launcher Icons from inside the app, and then control them easier - like the other answer suggests).
Bottom line, this is not easily done using standard Android framework to the best of my knowledge.
I have two questions for a Slide App StartUp, when executed in Android.
1 - Is there any way of changing the menu icon color?
2 - I am using a SplashScreen but, in Android, after the SplashScreen, a blank panel is presented to the user. Is there any way of filling this panel with an image? (Note: in iOS this startup panel is filled with the splashscreen image).
1_ Yes, this icon is copy of the system icon and change with the "Android Base Style". If you use "Dark" it will use one icon and if you use "Light" it will use other.
Also you can use a custom one if you override the file:
gx_drawer_icon_dark.png
in all the drawables folders:
Android\FlexibleClient\res\drawable-hdpi
Android\FlexibleClient\res\drawable-xhdpi
etc.
2_ You should use the Slide.Start event here.:
http://wiki.genexus.com/commwiki/servlet/hwiki?Slide.Start+Event,
and call an intro SDPanel
Is there any way that set the application Icon and Name from an external resource such as an image which embedded inside the assets/ folder in the project?
Or is there any way that let us set icon and name of app without using AndroidManifest.xml file?
Is there any way that set the application Icon and Name from an external resource such as an image which embedded inside the assets/ folder in the project?
No.
Or is there any way that let us set icon and name of app without using AndroidManifest.xml file?
No.
For your activities, you can override the title and/or icon used in the action bar or title bar, if that is your actual objective. However, you cannot change the values used for things like the home screen launcher icon or your app's entry in the application list in Settings.
No it is not possible . You should send an update and things would change in accordance with AndroidManifest.xml .
So what I will suggest is, to send an update
I found the answer. by Using APKtool
I am trying to put a dynamic value in the launcher icon of android, as number of messages will be displayed in the message icon. As the icon is static and initialised before the application starts, Is there any way to achieve this??
For Android Launcher Icon you can't. It is impossible. (Or by Making your own launcher) The only one thing is you have to make a Android-Widget for this purpose. Which looks like a application icon. But it will act as a widget.
Also Make a dynamic launcher icon
simple answer is you can't do it also this question says the same. But there may be advance tricky methods/ways that I'm not aware of.
But you may try and develop widgets that changes dynamically.
You have to design your icon as a selector instead of drawable. Have a look at this.
You cant update because its related to manifest.xml stuff only possible with software upgrade.