2014-11-25 33 views
0

我正在開發一個應用程序,需要在應用程序中打開(.xls/.xlsx/.doc/.docx/.pdf)擴展名。請告訴我這是否可行? 。我們如何打開這些所有獨立應用程序?如何在應用程序內打開文檔或PDF擴展文件

+0

[jOpenDocument(http://www.jopendocument.org/) – 2014-11-25 11:00:30

+0

是的,你可以通過使用可用庫閱讀內容打開它們的內部應用程序像jxl.jar等谷歌獲取每個資源。順便說一句,SO不是意見。 http://stackoverflow.com/help/on-topic。請嘗試一些代碼並在此尋求幫助。 – 2014-11-25 11:02:17

回答

0

您可以使用此方法打開一個文件,是目前在SD卡

/* Browses the SD Card using Intent Action Get Content */ 
    private void browseFileFromSDCard() { 
     TLog.i(LOG, "Browse File From SD Card"); 
     Intent selectFile; 
     Intent intent; 
     selectFile = new Intent(Intent.ACTION_GET_CONTENT); 
     selectFile.setType("file/*"); 
     intent = Intent.createChooser(selectFile, "Select a file"); 
     try { 
      startActivityForResult(intent, SELECT_FILE); 
     } catch (ActivityNotFoundException ex) { 
      TLog.w(LOG, "Activity Not found Exception"); 
      String fileManagerNotFoundMessage = getResources().getString(R.string.file_manger_not_found_message); 
      Toast.makeText(this, fileManagerNotFoundMessage, Toast.LENGTH_SHORT).show(); 
     } 
    } 
+0

用戶想要打開應用程序中的文件,而不是使用外部應用程序,即他想在應用程序中使用pdf/xls/doc閱讀器,而不使用其他pdf/doc閱讀器。你的回答不是問題的解決方案。 – 2014-11-25 11:06:29

相關問題