使用“APK编辑器”这款APP就可以把应用程序图标更换,以百度网盘图标兄配为例方法步骤如下:
1、需要先卸载百度网盘。
2、手机安装并打开apk编辑器。
3、点击第咐尘并一个选择项。
4、点击百度网盘。
5、选择第三个常用编辑
6、点击“启动器图标”。
7、找到想要更换的图标。
8、系统提示已成功修改。
9、打开百度网盘,重新安装。
10、安装完成,图标已更换衡迹。
Android应用,创建桌面图标先在注孝历册巧枝搜activity时,需要添加一个action为android.intent.action.CREATE_SHOERTCUT的intentFilter。1.创建图标代码如下:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT"/>
</intent-filter>
</activity>
2.接下来就是就是设置快捷方式的图标、名称、事件等属性。
public void createShortCut(){
Intent addShortCut
if(getIntent().getAction().equals(Intent.ACTION_CREATE_SHORTCUT)){//判断是否需要添加快捷方式
addShortCut = new Intent()
addShortCut.putExtra(Intent.EXTRA_SHORTCUT_NAME , "快捷方式")//快捷方式的名称
Parcelable icon = ShortcutIconResource.fromContext(this, R.drawable.icon)//搭腔显示的图片
addShortCut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon)//快捷方式激活的activity,需要执行的intent,自己定义
addShortCut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent())
setResult(RESULT_OK, addShortCut)//OK,生成
}else{//取消
setResult(RESULT_CANCELED)
}
}
3.向桌面再增加一个图标
Intent shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT") //快捷方式的名称
shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name))
shortcut.putExtra("duplicate", false)//不允许重复创建
//指定当前的Activity为快捷方式启动的对象: 如 com.everest.video.VideoPlayer
//注意: ComponentName的第二个参数必须加上点号(.),否则快捷方式无法启动相应程序
// ComponentName comp = new ComponentName(this.getPackageName(), "."+this.getLocalClassName())
// shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(Intent.ACTION_MAIN).setComponent(comp))
shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(this,WXEntryActivity.class))//快捷方式的图标
ShortcutIconResource iconRes = Intent.ShortcutIconResource.fromContext(this, R.drawable.ic_launcher)
shortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconRes)
sendBroadcast(shortcut)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)