lundi 18 mai 2015

Intent.createChooser() suggested App from Play Store

Is possible to show some suggested app not installed on the device when the chooser dialog is empty because it has a not common extension?

Intent install = new Intent();
install.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
File gpxFile = new File("path_to_file");
if(!gpxFile.isDirectory())
    gpxFile.mkdir();
install.setAction(Intent.ACTION_VIEW);
install.setDataAndType(Uri.fromFile(gpxFile),"application/xml");
Intent chooser = Intent.createChooser(install, "Open the .gpx file");
startActivity(chooser);

This is my code of my chooser now. The file I want to open is a .gpx file. If i have some apps installed on my device that can open gpx files, it works well, in case i haven't, the file chooser is empty with a message (eg. No apps available to open this file). When the chooser is empty is possible to show some suggested apps on the store that can open this file extension? Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire