Launch installed application with launch activity null
<p>I am using the following code to get a list of installed applications and launch them.It only opens application like calculator or clock.When i try to open applications like contacts or camera it does not work as their launch activity is null.How do i open such applications.</p>

<p>In the below code s[5] points to the camera.</p>

<pre><code>       final PackageManager pm = getPackageManager();
    List&lt;ApplicationInfo&gt; packages = pm
        .getInstalledApplications(PackageManager.GET_META_DATA);


    for (ApplicationInfo packageInfo : packages) 
    {

        s[i]=packageInfo.packageName;
        i++;

        Log.d(TAG, "Installed package :" + packageInfo.packageName);
        Log.d(TAG,"Launch Activity :"+ pm.getLaunchIntentForPackage(packageInfo.packageName));

    }


}



    Intent mIntent = getPackageManager().getLaunchIntentForPackage(s[5]);


        try {
            startActivity(mIntent);

        } 
        catch (Exception err) {
            Toast t = Toast.makeText(getApplicationContext(),
                    "Not Found", Toast.LENGTH_SHORT);
            t.show();
        }
</code></pre>

<p>}</p>

<p>}</p>
