2014-06-12 25 views
6

Sto usando android-pdfview-1.0.2.jar ho trovato here Link al progetto principale è here che sto cercando di caricare PDF come seguecome aprire PDF in Android usando pdfview

PDFView pdfView= (PDFView) findViewById(R.id.pdfView); 
pdfView.fromAsset("sample.pdf") 
.defaultPage(1) 
.showMinimap(false) 
.enableSwipe(true) 
.onLoad(this) 
.onPageChange(this) 
.load(); 

I hanno aggiunto pdfView nel mio layout, come illustrato di seguito

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" > 

    <com.joanzapata.pdfview.PDFView 
     android:id="@+id/pdfView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 

</FrameLayout> 

durante l'esecuzione sto ottenendo seguente errore:

06-12 17:10:10.015: E/AndroidRuntime(21726): FATAL EXCEPTION: AsyncTask #1 
06-12 17:10:10.015: E/AndroidRuntime(21726): java.lang.RuntimeException: An error occured while executing doInBackground() 
06-12 17:10:10.015: E/AndroidRuntime(21726): at android.os.AsyncTask$3.done(AsyncTask.java:299) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.util.concurrent.FutureTask.setException(FutureTask.java:219) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.util.concurrent.FutureTask.run(FutureTask.java:239) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.lang.Thread.run(Thread.java:838) 
06-12 17:10:10.015: E/AndroidRuntime(21726): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load vudroid from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.klouddata.pdffileexample-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.klouddata.pdffileexample-2, /vendor/lib, /system/lib]]]: findLibrary returned null 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.lang.Runtime.loadLibrary(Runtime.java:359) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.lang.System.loadLibrary(System.java:514) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at org.vudroid.core.VuDroidLibraryLoader.load(VuDroidLibraryLoader.java:13) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at org.vudroid.pdfdroid.codec.PdfContext.<clinit>(PdfContext.java:13) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at com.joanzapata.pdfview.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:50) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at com.joanzapata.pdfview.DecodingAsyncTask.doInBackground(DecodingAsyncTask.java:31) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at android.os.AsyncTask$2.call(AsyncTask.java:287) 
06-12 17:10:10.015: E/AndroidRuntime(21726): at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
06-12 17:10:10.015: E/AndroidRuntime(21726): ... 3 more 
+0

Dov'è il tuo codice di AsyncTask? –

+0

Non ho alcun asynctask nel mio codice – DCoder

+0

Mostra nella tua eccezione che 'FATAL EXCEPTION: AsyncTask' e' java.lang.RuntimeException: si è verificato un errore durante l'esecuzione di doInBackground() ' –

risposta

5

problema risolto con l'aggiunta di cartelle armeabi-V7A che può essere trovato here

ora esempio.pdf sembra enter image description here

+0

Ciao @DCoder hai incontrato durante la visualizzazione del pdf è sempre orizzontale? come l'hai risolto? Grazie. –

+0

Hai copiato incollare le cartelle nella cartella libs? Oppure è il file .so stesso? – jay

Problemi correlati