/**¼ôÄÆ »ý¼ºÇÏ´Â ±¸¹®ÀÔ´Ï´Ù.**/
private static final String EXTRA_KEY = "com.example.testshortcut.TestshortCut";
Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
shortcutIntent.setClassName(this, this.getClass().getName());
shortcutIntent.putExtra(EXTRA_KEY, "ApiDemos Provided This Shortcut");
// Then, set up the container intent (the response to the caller)
Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Å×½ºÆ®ÀÓ");
Parcelable iconResource = Intent.ShortcutIconResource.fromContext(
this, R.drawable.ic_launcher);
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
// Now, return the result to the launcher
//sendBroadcast(intent);
setResult(RESULT_OK, intent);
/** »óȲ¿¡ µû¶ó ºê·ÎµåÄɽºÆ®³ª ¹ÝȯÀÎÅÙÆ®·Î ó¸®ÇÕ´Ï´Ù.**/
AndroidManifest.xml
<activity android:name="TestshortCut"/>
<activity-alias android:name=".CreateShortcuts"
android:targetActivity=".TestshortCut"
>
<intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity-alias>
¸ÞÀÎÀº ´Ù¸¥ ActivityÀÌ°í
À§ÀÇ TestshortCutÀº À§ÀÇ ¼ôÄÆÀ» »ý¼ºÇÏ´Â ¾×ƼºñƼ ÀÔ´Ï´Ù.
Á¦°¡ ±Ã±ÝÇÑ ºÎºÐÀº
Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
À̺κаú
activity-alias°¡
ÇÏ´Â ÀÏÀε¥.
¼ôÄÆ¿¡¼ Intent.ACTION_MAINÀ̶ó°í Á¤ÀÇÇÏ¿´À» °æ¿ì
ÀÎÅÙÆ® ÇÊÅÍ¿¡ ÀÇÇØ Ã¹¹ø° ¿¢Æ¼ºñƼ°¡ ÁöÁ¤ÀÌ µÇ¸®¶ó ¿¹»óµË´Ï´Ù.
¸¸¾à ù¹ø° ¿¢Æ¼ºñƼ°¡ ÁöÁ¤µÈ´Ù°í ÇÏ´õ¶óµµ
»ý¼ºµÈ ¼ôÄÆÀÌ ¸ÞÀÎ ¿¢Æ¼ºñƼ´ø µÎ¹ø° ¿¢Æ¼ºñƼ´ø ¸µÅ©¸¦ Ÿ°í ¿Í¾ßµÇ´Âµ¥,
°æ·Î¸¦ ãÁö ¸øÇÕ´Ï´Ù.
´Ü¼øÈ÷ À§ÀÇ ¼Ò½º¸¦ °¡Áö°í ÇϳªÀÇ ¿¢Æ¼ºñƼ¸¸ÀÌ Á¸ÀçÇÒ¶§,
Àû¿ë½ÃÅ°¸é Á¤»ó ÀÛµ¿Çϳª ¾î°¼ÀÎÁö ¿¢Æ¼ºñƼ°¡ µÎ°³ ÀÌ»óÀÌ µÇ¹ö¸®¸é
ÀÛµ¿À» ÇÏÁö ¾Ê½À´Ï´Ù. ¾î´ÀºÎºÐ¿¡¼ ¼öÁ¤ÇؾߵǴ°ɱî¿ä?
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)