请问在android下创建快捷方式shortcut,这个icon的尺寸需要多大?需要适配不同设备的分辨率吗?
function createShortcut(){
if(plus.os.name !== "Android"){ return; }
var Intent = null, BitmapFactory = null;
var main = null;
// 导入要用到的类对象
Intent = plus.android.importClass("android.content.Intent");
BitmapFactory = plus.android.importClass("android.graphics.BitmapFactory");
// 获取主Activity
main = plus.android.runtimeMainActivity();
// 创建快捷方式意图
var shortcut = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
// 设置快捷方式的名称
shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, FD.quanName);
// 设置不可重复创建
shortcut.putExtra("duplicate", false);
// 设置快捷方式图标
var iconPath = plus.io.convertLocalFileSystemURL("_www/images/appicon.png"); // 将相对路径资源转换成系统绝对路径
var bitmap = BitmapFactory.decodeFile(iconPath);
console.log(iconPath);
shortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON,bitmap);
// 设置快捷方式启动执行动作
var action = new Intent(Intent.ACTION_MAIN);
action.setComponent(main.getComponentName());
shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT,action);
// 广播创建快捷方式
main.sendBroadcast(shortcut);
console.log( "桌面快捷方式已创建完成!" );
}