Search code examples
androidfragmentpdfview

Could not find class com.joanzapata.pdfview.PDFView


I want open PDF in android using pdfview. https://github.com/JoanZapata/android-pdfview

This is my Layout code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

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

And this is my java code. I want open PDF in Fragment.:

        @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    View view = inflater.inflate(R.layout.infoinstalacion_fragment5, container, false);
    PDFView pdfView= (PDFView) view.findViewById(R.id.infoinstalacion_fragment5_pdfview);
    view.findViewById(R.id.infoinstalacion_fragment5_web_view);
    pdfView.fromAsset("horarios.pdf")
    .defaultPage(1)
    .showMinimap(false)
    .enableSwipe(true)
    .load();    
    return view;
}

This is the error:

04-15 00:05:06.504: E/dalvikvm(16177): Could not find class 'com.joanzapata.pdfview.PDFView', referenced from method com.kirolm.instalacionesdep.info.InfoInstalacionFragment5.onCreateView

04-15 00:05:06.514: E/AndroidRuntime(16177): android.view.InflateException: Binary XML file line #6: Error inflating class com.joanzapata.pdfview.PDFView

and

04-15 00:05:06.514: E/AndroidRuntime(16177): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.joanzapata.pdfview.PDFView" on path: DexPathList[[zip file "/data/app/com.kirolm.instalacionesdep-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.kirolm.instalacionesdep-1, /vendor/lib, /system/lib]]

Any Ideas? Thank!


Solution

  • Solved!

    Add Support Library in Eclipse. In my Android Proyect.

    Thank!