Affichage des files Excel dans mon application Android

Je travaille sur une application Android dans laquelle je dois ouvrir et fermer des files excel sur le clic de button. Ces files Excel seront lisibles. Après avoir fermé le file excel, il devrait me diriger vers l'application.

Suggérez-moi une façon de le faire.

    Voici un itinéraire manuel.

    Comment lire le file excel à l'aide de JXL 2.6.12 jar

    mais voici un peu plus facile.

    application ouverte

    mais je suppose que vous devez découvrir le MIME TYPE .

    MODIFIER

    J'ai aussi eu le type de mime

    Définir le type mime pour le document excel

    METTRE À JOUR

    donc quelque chose comme ça pourrait fonctionner.

     Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/vnd.ms-excel"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(OpenPdf.this, "No Application Available to View Excel", Toast.LENGTH_SHORT).show(); } Intention intention = new Intent (Intention.ACTION_VIEW); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/vnd.ms-excel"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(OpenPdf.this, "No Application Available to View Excel", Toast.LENGTH_SHORT).show(); } intention.setDataAndType (path d'access, "application / vnd.ms-excel"); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/vnd.ms-excel"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(OpenPdf.this, "No Application Available to View Excel", Toast.LENGTH_SHORT).show(); } intention.setFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/vnd.ms-excel"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(OpenPdf.this, "No Application Available to View Excel", Toast.LENGTH_SHORT).show(); } startActivity (intention); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/vnd.ms-excel"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(OpenPdf.this, "No Application Available to View Excel", Toast.LENGTH_SHORT).show(); } catch (ActivityNotFoundException e) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/vnd.ms-excel"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(OpenPdf.this, "No Application Available to View Excel", Toast.LENGTH_SHORT).show(); } Toast.makeText (OpenPdf.this, "Aucune application disponible pour afficher Excel", Toast.LENGTH_SHORT) .show (); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(path, "application/vnd.ms-excel"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Toast.makeText(OpenPdf.this, "No Application Available to View Excel", Toast.LENGTH_SHORT).show(); }