J'ai essayé d'ouvrir pdf en utilisant pdf reader. mais aucune application n'a été trouvée.Comment détecter Setaction dans l'intention android?
comment puis-je trouver est-il une application disponible avant d'afficher le message.
Je veux ouvrir la fenêtre contextuelle de l'application uniquement s'il existe une application pour ouvrir le fichier pdf, comment puis-je l'ajouter?
Intent target = new Intent();
target.setType("application/pdf");
target.setData(Uri.parse(attachment));
target.setAction(Intent.ACTION_GET_CONTENT);
Intent intent = Intent.createChooser(target, "Open File");
Regardez ceci: https://stackoverflow.com/questions/15407502/how-to-check-if-an-intent-can-be-handled-from-some-activity –