I tried using:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + file_to_open), "image/*");
context.startActivity(intent);
or
Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(file_to_open)),"image/jpeg");
context.startActivity(intent);
and it works, but when I try leaving the image viewing intent, I get a RuntimeException, StaleDataException Attempted to access a cursor after it has been closed
when I try launching a different intent, it works, so it's not related to pausing or resuming my activity
please someone help
turns out that it's other intents too, like email intent, when canceled, makes that error
found the answer. it had nothing to do with the intent itself, but with the fact I was using the following method:
notice that the managedQuery has been deprecated, and even if you do decide to use it, you should never close the cursor or set it to null as seen in the following answer:
Unable to resume Activity error