Код говорит, что файл или каталог не найден - PullRequest
0 голосов
/ 18 июня 2019

Я получаю сообщение об ошибке при попытке загрузить pdf из внутреннего хранилища. Это говорит о том, что файл или каталог не был найден. Это в моем приложении для Android.

File myfile= new File(openPDF.this.getFilesDir().getAbsolutePath() +"/"+fileName);

        final PDFView pdfView=findViewById(R.id.pdfView);


      //  pdfView =(PDFView)findViewById(R.id.pdfView);
        // pdfView.fromUri(Uri.parse(Utils.getRootDirPath(this)+"/"+filename))
        // pdfView.fromAsset("aqida1.pdf")

        pdfView.fromFile(myfile)
                .enableSwipe(true) // allows to block changing pages using swipe
                .swipeHorizontal(false)
                .enableDoubletap(true)
                .defaultPage(0)// called after document is rendered for the first time
                .enableAntialiasing(true) // improve rendering a little bit on low-res screens
                .enableAnnotationRendering(true)
                .scrollHandle(new DefaultScrollHandle(getApplicationContext(), false))
                .onRender(new OnRenderListener() {
                    @Override
                    public void onInitiallyRendered(int nbPages, float pageWidth, float pageHeight) {
                        pdfView.fitToWidth();


                    }
                })
                .load();
        pdfView.useBestQuality(true);
        pdfView.getKeepScreenOn();

2019-06-18 05: 36: 58.680 11555-11555 / comechoman.dailynation E / PDFПросмотреть: Ошибка загрузки PDF java.io.FileNotFoundException: открыть не удалось: ENOENT (нет такого файла или каталога) на android.os.ParcelFileDescriptor.openInternal (ParcelFileDescriptor.java:313) на android.os.ParcelFileDescriptor.open (ParcelFileDescriptor.java:211) на com.github.barteksc.pdfviewer.source.FileSource.createDocument (FileSource.java:37) на com.github.barteksc.pdfviewer.DecodingAsyncTask.doInBackground (DecodingAsyncTask.java:53) на com.github.barteksc.pdfviewer.DecodingAsyncTask.doInBackground (DecodingAsyncTask.java:25) на android.os.AsyncTask $ 2.call (AsyncTask.java:335) в java.util.concurrent.FutureTask.run (FutureTask.java:266) в java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162) в java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:636) at java.lang.Thread.run (Thread.java:764) 2019-06-18 05: 36: 58.714 11555-11610 / comechoman.dailynation E / [EGL-ERROR]: __egl_platform_cancel_buffers: 644: surface-> num_buffers (4) 2019-06-18 05: 37: 13.152 274-274 /? E / memtrack_graphic: graphic_memtrack_get_memory ошибка при открытии / sys / kernel / debug / ion / clients / 593: в доступе отказано

...