이미지를 앱의 기본 이미지말고 갤러리에서 가져온 이미지로 숏컷을 만들려고합니다만...
잘 적용되는 런처가 있고 안되는 런처가 있더라구요...
인터넷으로 올라와있는 오픈소스로는 적용이 되는게 있고 안되는게 있는거같은데...
어디서 문제인건지 좀 조언부탁드립니다...ㅠㅠ
아래는 적용할때 쓴 소스입니다... 문제점있으면 답변 꼭좀부탁드릴게요!
// 숏컷
public void shortcutIntent(String shortcutName, String type, String packagename, String classname, Bitmap bitmap) throws NameNotFoundException {
Intent shortcutIntent = null;
PackageManager manager = null;
try{
//새로운 Intent 생성, shortcut클릭시 발생하는 Intent로 사용
shortcutIntent = new Intent(Intent.ACTION_MAIN);
manager = this.getPackageManager();
shortcutIntent = manager.getLaunchIntentForPackage(packagename);
}catch(Exception e){}
shortcutIntent.setClassName(packagename, classname);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
Intent shortcut;
if(type.equals(INSTALL)) {
shortcut = new Intent(INSTALL_SHORTCUT);
shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, shortcutName);
Bitmap b = Bitmap.createScaledBitmap(bitmap, 128, 128, false);
if(round_state == 1){
b = getRoundedCornerBitmap(b);
}else if(round_state == 2){
b = getCircleBitmap(b);
}
shortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON, b);
shortcut.putExtra("duplicate", false);
} else {
shortcut = new Intent(UNINSTALL_SHORTCUT);
shortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
shortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, shortcutName);
}
sendBroadcast( shortcut );
onBackPressed();
}