android - How i prompt for user to open a pdf file with adobe reader -
how can open file using adobe reader. pdf file created application when user want open prompt should open adobe reader.it when want share apps using mobile prompt occurs bluetooth etc....i want code that.suggest me idea.
you can utilize code, it's perfect file format.
file file = new file("path of file"); string extension=mimetypemap.getfileextensionfromurl(path); mimetypemap map = mimetypemap.getsingleton(); string mimetype=map.getmimetypefromextension(extension); packagemanager packagemanager = activity.getpackagemanager(); intent testintent = new intent(intent.action_view); testintent.settype(mimetype); list<?> list = packagemanager.queryintentactivities(testintent, packagemanager.match_default_only); if (list.size() > 0 && file.isfile()) { intent intent = new intent(); intent.setaction(intent.action_view); uri uri = uri.fromfile(file); intent.setdataandtype(uri, mimetype); activity.startactivity(intent); }
android file-handling
No comments:
Post a Comment