Waza_Be Waza_Be - 2 months ago 10x
Android Question

Failed to launch shortcut: Application is not installed on your phone

I am trying to create a desktop shortcut to one of my Activity in Android.
I use the code that work in every tuto example i have read:

final Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
ComponentName name = new ComponentName(getPackageName(), ".MyActivity");


final Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);

intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "blabla");
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, icon);


And I added the MAIN action to my activity:

<activity android:label="@string/app_name" android:name=".MyActivity">
<action android:name="android.intent.action.MAIN" />

The result is that the application does not want to launch!

In the Logcat everything seem fine:

10-01 01:17:51.591: INFO/ActivityManager(2424): Starting activity: Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=my.package.name/.MyActivity bnds=[125,384][235,522] (has extras) }

And the Home tell me that the application is not Installed.

Please help me, I am totally lost and spend a few hours trying to solve the issue and read all info I can get.

Thank a lot!


Try this:

  1. get rid of the <intent-filter>
  2. get rid of the ACTION_MAIN and just use new Intent(this, MyActivity.class)
  3. add android:exported="true" to your element in the manifest