How to open a text file in default view on button click in android -


i want users read instruction use android application text or pdf file when click instruction button. how should read text/pdf file on button click in default view in android?

likely best way launch intent action_view action , provide file desire.

intent intent = new intent(intent.action_view, uri.fromfile(file)); intent.settype("application/pdf");  startactivity(intent); 

note dependent on there being application on device registered handle pdf mime type. can choose have text or perhaps rich text instead changing type.


Comments

Popular posts from this blog

c# - Getting control value when switching a view as part of a multiview -

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -