Wie offenes Verzeichnis in Android programmatisch
Posted: 04 Mar 2025, 07:00
In meiner App habe ich eine Liste der Dateien, die in ListActivity angezeigt werden. Jetzt möchte ich zusätzliche Option wie Windows hinzufügen: (Ort des Ordners öffnen), um das Verzeichnis aus dieser Datei zu öffnen. Ich teste einen Code, aber keine Ausnahme werfen: < /p>
File file=new File(path);
Uri url = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(url);
startActivity(intent);
< /code>
Exception: < /p>
03-08 21:14:55.451: E/AndroidRuntime(15708):
android.content.ActivityNotFoundException: No Activity found to handle Intent {
act=android.intent.action.VIEW dat=file:///storage/extSdCard/Bluetooth }
< /code>
Was kann ich tun? < /p>
File file=new File(path);
Uri url = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(url);
startActivity(intent);
< /code>
Exception: < /p>
03-08 21:14:55.451: E/AndroidRuntime(15708):
android.content.ActivityNotFoundException: No Activity found to handle Intent {
act=android.intent.action.VIEW dat=file:///storage/extSdCard/Bluetooth }
< /code>
Was kann ich tun? < /p>