2013-02-13 66 views
0

這條線上有一個錯誤,我不明白該說什麼。而且還有我是用qoppa.jar的一個庫如何解決售後服務這個問題上任何一個可以幫助我如何在java代碼中解決這個java.lang.ExceptionInInitializerError?

m_LoadedDoc = new PDFDocument(new FilePDFSource((String) path[0]), PDFViewer.this); 




    java.lang.ExceptionInInitializerError 
    at com.qoppa.android.pdfProcess.PDFDocument$1.b(Unknown Source) 
    at com.qoppa.android.pdfViewer.e.p.b(Unknown Source) 
    at com.qoppa.android.pdfProcess.PDFDocument.b(Unknown Source) 
    at com.qoppa.android.pdfProcess.PDFDocument.<init>(Unknown Source) 
    at com.qoppa.android.pdfProcess.PDFDocument.<init>(Unknown Source) 
    at com.pdfplugin.PDFViewer$LoadDocument.doInBackground(PDFViewer.java:469) 
+0

你能記錄路徑[0]看完整路徑嗎?它可能是空的或文件的相對路徑。 – 2013-02-13 05:00:34

+0

是的路徑是正確的。 – 2013-02-13 05:05:25

+0

它是什麼?文件是否存在?你有沒有嘗試過另一個文件? – 2013-02-13 05:06:25

回答

0

有一個魔線需要讀取文件之前調用:

// Magic: Register asset manager for font loading. 
StandardFontTF.mAssetMgr = getContext().getAssets(); 

// Now you can read the document. 
PDFDocument doc = new PDFDocument(new FilePDFSource(path), PDFViewer.this); 

您可能還需要包含示例項目中的assets/fontsassets/cmaps目錄。