2

I need to open my app private files(pdf, txt, etc) with some reader applications by using the android default View intent(Intent.ACTION_VIEW).

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setDataAndType(uri, "application/*");
    startActivity(intent);

But I don't need the file be cached to the reader application. Is there any way to do this? Or do I need to integrate the reader library within my app to prevent these caching.

Alvin Varghese
  • 679
  • 2
  • 9
  • 17
  • 1
    You might want to read this http://stackoverflow.com/questions/36829176/how-to-delete-app-cache-for-all-apps-in-android-m – Raghunandan Feb 01 '17 at 04:44
  • Thank you for the response. So the best way is to show the files within my app? Let me know your thoughts on this.@Raghunandan – Alvin Varghese Feb 01 '17 at 04:57
  • yup i guess so. I have not done this before. Looks like its the way to go.. – Raghunandan Feb 01 '17 at 04:58
  • As a general rule- there's no way to force any app launched by intent from doing anything. If you're worried about security, assume the worst case- that the first thing any app you launch does is post it to facebook. – Gabe Sechan Feb 01 '17 at 05:24

0 Answers0