jeudi 21 mai 2015

Office document not working in ACTION_VIEW intent

I am trying to open an office document with any other office reader using Intent.ACTION_VIEW but it only works in Google Sheets or Google Docs, with other applications like for example Polaris Office or any other, it doesn't work at all. Here is the code that I am wrote:

Intent intent = new Intent(Intent.ACTION_VIEW);
File mFile = new File("folder", Integer.toString(myFile.hashCode()));
intent.setDataAndType(Uri.fromFile(mFile), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
startActivity(intent);

Is something wrong with the code?

Aucun commentaire:

Enregistrer un commentaire