user6765242 user6765242 - 1 month ago 9
Java Question

Why does this intent not work

Why is this intent not working:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setType(mime);
i.setData(Uri.parse(temp + "/file"));
startActivity(i);


When I don't add the
i.setData()
it doesn't crash, but it has not the path of the File.
My stacktrace:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=/storage/emulated/0/.$RecycleBin$/temp_/file.mp4 }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1798)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)
at android.app.Activity.startActivityForResult(Activity.java:3951)
at android.app.Activity.startActivityForResult(Activity.java:3912)
at android.app.Activity.startActivity(Activity.java:4235)
at android.app.Activity.startActivity(Activity.java:4203)
at com.lurzapps.reciclebin.MainActivity$100000010.onClick(MainActivity.java:293)
at android.view.View.performClick(View.java:5201)
at android.view.View$PerformClick.run(View.java:21209)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5525)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

No Activity found to handle Intent { act=android.intent.action.VIEW dat=/storage/emulated/0/.$RecycleBin$/temp_/file.mp4 }


Thanks for any help.

Answer

It is in a hidden folder. Thats the Problem.

Comments