Hi guys and girls (of course)
I have this method to open a file
public static void openFile(String filePath, Activity activity) {
try {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("file://"+filePath));
activity.startActivityForResult(intent, 10);
}catch (Exception e){
e.printStackTrace();
Toast.makeText(context, "Error abriendo."+filePath+" Abrir manualmente", Toast.LENGTH_LONG).show();
}
}
but when I set the path to my file for example image.jpg that is on my sdcard, it always tries to open it with the PDF-Drive, and of course this gives an error when trying to open this file. But when I open this image from the folder browser, it opens with the default image viewer. What am I doing wrong?