NullPointerException
我正在尝试使用出现在这一行 的 andorid 代码在科尔多瓦制作一个 pdf 阅读器插件svScroll.setPDFViewer(this);
有不同的类是第一个我调用 thiaPDFViewer
类
PDFViewer m_PDFViewer = new PDFViewer(cordova.getActivity());
所以任何机构都可以帮助我解决这个问题
public class PDFViewer implements IPassword
{
private LinearLayout llPagePane;
private QScrollView svScroll;
private float m_CurrentScale;
private PDFDocument m_Document;
private float m_FitToWidth;
private LRUCache m_PageContentsCache;
private Vector<PDFPageView> m_PageViews;
private Activity m_ParentActivity;
private TouchHandlerView m_TouchHandler;
public PDFViewer(Activity parentActivity)
{
m_ParentActivity = parentActivity;
StandardFontTF.mAssetMgr = m_ParentActivity.getAssets();
llPagePane = (LinearLayout) parentActivity.findViewById(R.id.pagepane);
svScroll = (QScrollView) parentActivity.findViewById(R.id.scrollview);
svScroll.setPDFViewer(this);
m_PageContentsCache = new LRUCache(20);
m_PageViews = new Vector<PDFPageView>();
m_TouchHandler = new TouchHandlerView(this);
}
java.lang.NullPointerException
at com.pdfplugin.PDFViewer.<init>(PDFViewer.java:55)
at com.pdfplugin.pdfreader$1.run(pdfreader.java:69)
public void setPDFViewer(PDFViewer viewer)
{
m_PDFViewer = viewer;
}