android扩展类无法解决

时间:2018-02-09 18:20:31

标签: android

错误无法解析符号" pdf.viewer.activity" code and error picture

public class MainActivity extends AppCompatActivity ,net.sf.andpdf.pdfviewer.PdfViewerActivity {

/**
 * The {@link android.support.v4.view.PagerAdapter} that will provide
 * fragments for each of the sections. We use a
 * {@link FragmentPagerAdapter} derivative, which will keep every
 * loaded fragment in memory. If this becomes too memory intensive, it
 * may be best to switch to a
 * {@link android.support.v4.app.FragmentStatePagerAdapter}.
 */

Context context;
/**
 * The {@link ViewPager} that will host the section contents.
 */
PDFView pdfView;

String[] abc={"kotlin.pdf","book1.pdf","book2.pdf"};
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
 pdfView= (PDFView) findViewById(R.id.pdfView);
   pdfView.fromAsset(abc[1]).load();




}
}

1 个答案:

答案 0 :(得分:1)

在Java中没有多重继承:

public class MainActivity extends AppCompatActivity ,net.sf.andpdf.pdfviewer.PdfViewerActivity {

应该只有一个类,在您的情况下可能是PdfViewerActivity:

public class MainActivity extends net.sf.andpdf.pdfviewer.PdfViewerActivity {