title: how to put a shortcut of an activity into the launcher?
body: <p>i'm trying to do something that is described briefly on the next link:</p>
  
  <p><a href="https://stackoverflow.com/questions/4679022/how-to-create-a-shortcut-which-leads-to-a-non-launcher-activity">link</a></p>
  
  <p>meaning, i have an activity that can be even on another application (but for now let's focus on an activity that my app has) , which i want to be able to create a shortcut to it.</p>
  
  <p>for terminology , let's say that the activity that creates the shortcut is named "ShortcutCreatorActivity" ,and the activity that gets started is "MyActivity" .</p>
  
  <p>what i got from what is written is that the ShortcutCreatorActivity should be defined in the manifest as:</p>
  
  <pre><code>&lt;activity android:icon="@drawable/ic_launcher"
    android:label="ShortcutActivity" android:name="com.my_app.ShortcutCreatorActivity"&gt;
    &lt;intent-filter&gt;
      &lt;action android:name="android.intent.action.CREATE_SHORTCUT" /&gt;
      &lt;category android:name="android.intent.category.DEFAULT" /&gt;
    &lt;/intent-filter&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>and what i got in its java code is:</p>
  
  <pre><code>public class ShortcutCreatorActivity extends Activity
    {
    @Override
    protected void onCreate(final Bundle savedInstanceState)
      {
      super.onCreate(savedInstanceState);
      final Intent shortcutIntent=new Intent("com.my_app.MyActivity");
      final ShortcutIconResource iconResource=Intent.ShortcutIconResource.fromContext(this,R.drawable.ic_launcher);
      final Intent intent=new Intent();
      intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT,shortcutIntent);
      intent.putExtra(Intent.EXTRA_SHORTCUT_NAME,"Shortcut Test");
      intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,iconResource);
      setResult(RESULT_OK,intent);
      Toast.makeText(this,"shortcut created",Toast.LENGTH_SHORT).show();
      finish();
      }
    }
  </code></pre>
  
  <p>yet i keep getting the same message of "application not found" when clicking on the shortcut , and the log :</p>
  
  <pre><code>ActivityManager(232): Starting: Intent { act=com.my_app.MyActivity flg=0x10200000 bnds=[80,150][160,250] } from pid 3956
  </code></pre>
  
  <p>can anyone please help me? what is missing?
  i've also tried some intent filters for the MyActivity activity inside the manifest. nothing helped...</p>
  
  <hr>
  
  <p>@liro
  i don't think it matters , since i've specified the exact full path to the class , including the package name.</p>
  
  <hr>
  
  <p>everyone, please, if you have a working project, that would be perfect .</p>