Android Launching an application chooser with appropriate list of applications
<p>Although I have seen several threads and tutorials on this topic, I guess I still have some confusion on how an application can be chosen from a list of applications to display a file.</p>

<p>I have a Activity which has a list view in it. This list view is bound with file paths (so a file browser of sorts). When we click on a specific file type, I need a list of applications that can open that file.</p>

<p>So far this is what I have in the OnItemClick for the list item:</p>

<pre><code>Intent myIntent = new Intent();
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
myIntent.setAction(Intent.ACTION_VIEW);
myIntent.addCategory("android.intent.category.DEFAULT");
myIntent.setData(Uri.fromFile(new File(filePath)));
</code></pre>

<p>When I run this on my phone, the error is:
<code>No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.DEFAULT] dat=file:///</code></p>

<p>When I do the same in a file browser application (downloaded from the marketplace), I get two options (QuickOffice and Word to Go), both of which I have installed on my phone.</p>

<p>Could someone guide me as to what else is needed here? Things I have tried besides the above:</p>

<ol>
<li><p>Add the following entries to the manifest:</p>

<p><code>&lt;intent-filter&gt;
     &lt;action android:name="android.intent.action.MAIN" /&gt;
     &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
&lt;/intent-filter&gt;
&lt;intent-filter&gt;
  &lt;action android:name="android.intent.action.VIEW" /&gt;
  &lt;category android:name="android.intent.category.BROWSABLE" &gt;
  &lt;category android:name="android.intent.category.DEFAULT" &gt;
  &lt;data android:scheme="file" /&gt;
&lt;/intent-filter&gt;</code></p></li>
<li><p>Explicitly set the type:</p>

<p><code>myIntent.setDataAndType(Uri.fromFile(new File(filePath)),"*");</code></p></li>
</ol>

<p>Neither of this works, any help is appreciated.</p>

<p>Thanks!</p>
