Intent action_view File setType Datei-Explorer Problem

  • Antworten:1
  • Bentwortet
Aaron B.
  • Forum-Beiträge: 206

20.10.2013, 21:03:25 via Website

Hallo comunity!

Ich versuche mich gerade an einem Datei-Explorer, aber ich bin auf ein großes Problem gestoßen:

Wenn man auf eine Datei (!file.isDirectory() && file.exists()) tippt, soll ein Dialog "Öffnen mit..." erscheinen, der entsprechende Apps anzeigt.

Meine Versuche:
1//file = angetippte Datei
2
3Intent openIntent = new Intent();
4openIntent.setAction(Intent.ACTION_VIEW);
5openIntent.setData(Uri.fromFle(file));
6openIntent.setType("file/*");
7startActivity(Intent.createChooser(openIntent, "Öffnen mit..."));

Das Problem ist, dass der Chooser dann keine Anwendungen anzeigt.

Danke im Voraus für Antworten. :)

Antworten
Aaron B.
  • Forum-Beiträge: 206

21.10.2013, 19:14:43 via App

Ok ich habe es geschafft.

Für alle mit dem selben Problem:
Schaut euch mal die Klasse MimeTypeMap an. :)

Antworten