找不到 class com.joanzapata.pdfview.PDFView
Could not find class com.joanzapata.pdfview.PDFView
我想在 android 中使用 pdfview 打开 PDF。
https://github.com/JoanZapata/android-pdfview
这是我的布局代码:
<?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>
这是我的 java 代码。我想在 Fragment 中打开 PDF。:
@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;
}
这是错误:
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
和
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]]
有什么想法吗?
谢谢!
已解决!
在 Eclipse 中添加支持库。在我的 Android 项目中。
谢谢!
我想在 android 中使用 pdfview 打开 PDF。 https://github.com/JoanZapata/android-pdfview
这是我的布局代码:
<?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>
这是我的 java 代码。我想在 Fragment 中打开 PDF。:
@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;
}
这是错误:
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
和
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]]
有什么想法吗? 谢谢!
已解决!
在 Eclipse 中添加支持库。在我的 Android 项目中。
谢谢!