title: Intent filter for common file explorers
body: <p>I'm trying to associate my app with extension. I have read <a href="http://developer.android.com/guide/topics/intents/intents-filters.html" rel="nofollow noreferrer">documentation</a> and <a href="https://stackoverflow.com/questions/9518318/android-how-to-create-intent-filter-for-custom-file-extension-that-does-not-make">some</a> <a href="https://stackoverflow.com/questions/3760276/android-intent-filter-associate-app-with-file-extension">questions</a> about the problem. But major file explorers (like es file explorer, astro, file manager by Rhythm software) can't open my files.</p>
  
  <p>My <code>manifest</code> file:</p>
  
  <pre><code>&lt;activity android:name="com.comapping.android.map.MapActivity" android:configChanges="orientation|keyboardHidden"&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" android:host="*" android:pathPattern=".*\\.comap" android:mimeType="*/*" /&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="content" android:host="*" android:pathPattern=".*\\.comap" android:mimeType="*/*" /&gt;
      &lt;/intent-filter&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.SEARCH" /&gt;
          &lt;category android:name="android.intent.category.DEFAULT" /&gt;
      &lt;/intent-filter&gt;
      &lt;meta-data android:name="android.app.searchable"
          android:resource="@xml/searchable" /&gt;
  &lt;/activity&gt;</code></pre>
  
  <p>And If I try to open file from my application using next code everything works fine (chooser not shown):</p>
  
  <pre><code>String extension = "";
  int dotIndex = downloadedFile.lastIndexOf('.');
  if (dotIndex != -1) {
      extension = downloadedFile.substring(dotIndex + 1, downloadedFile.length());
  }
  
  // create an intent
  Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
  Uri data = Uri.fromFile(new File(downloadedFile));
  String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
  if (type == null || type.length() == 0) {
      // if there is no acceptable mime type
      type = "application/octet-stream";
  }
  intent.setDataAndType(data, type);
  
  // get the list of the activities which can open the file
  List resolvers = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
  if (resolvers.isEmpty()) {
      (new AlertDialog.Builder(context)
              .setMessage(R.string.AttachmentUnknownFileType)
              .setNeutralButton(R.string.NeutralButtonText, null)
              .create()).show();
  } else {
      context.startActivity(intent);
  }</code></pre>
  
  <p>If i try to open it using OpenIntents file manager everything is normal - showed long chooser with lots of apps and my app in the list.</p>
  
  <p>But if I try to open it with es file explorer or Rhythm file explorer - showed their custom chooser (open as text/image/video/audio). It's bad.</p>
  
  <p>And if I try to open it with Astro - it opens OpenIntent's file manager. It's also bad.</p>
  
  <p>Is there any solution of the problem? Who is wrong in such behavior?</p>
  
  <p>Thank you for any help.</p>