简体   繁体   English

在Android中以编程方式更改应用程序名称和图标?

[英]Change application name and icon programmatically in Android?

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. 您唯一能做的就是使用预定义的图标和标签定义多个Launcher活动,并以编程方式启用/禁用它们。

setComponentEnabledSetting (ComponentName componentName, int newState, int flags) 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. 最重要的是,据我所知,使用标准Android框架并不容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM