How to modify this code to display pdf file...... Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri,"video/*"); startActivity(intent);
@@EverydayProgrammer the picture of the book does not appear in the list of books. Glide.with(context).load(arrayList.get(position).getUri()).into(holder.imageView); How do I convert this code?
private Bitmap displayPdfPage(String pdfFilePath) throws IOException { ParcelFileDescriptor fileDescriptor = ParcelFileDescriptor.open(new File(pdfFilePath), ParcelFileDescriptor.MODE_READ_ONLY); PdfRenderer pdfRenderer = new PdfRenderer(fileDescriptor); PdfRenderer.Page page = pdfRenderer.openPage(0); Bitmap pageBitmap = Bitmap.createBitmap(page.getWidth(), page.getHeight(), Bitmap.Config.ARGB_8888); page.render(pageBitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY); page.close(); pdfRenderer.close(); return pageBitmap; } Use the above function to get pdf image but make sure to download the pdf file first and then parse the downloaded file path to the above function and it will return the first page of the pdf as bitmap.
when updating, the position of the videos will change. will you make it so that it does not change?
all well good but when click arrary list then dose not work and vedio play?plzz raplay....
Tôi không thấy vìdeo hiển thị trên app. ngài có thể giúp tôi được không ?
How to modify this code to display pdf file......
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri,"video/*");
startActivity(intent);
set "application/pdf" instead of "video/*"
@@EverydayProgrammer Thank you very much! i did
@@EverydayProgrammer the picture of the book does not appear in the list of books.
Glide.with(context).load(arrayList.get(position).getUri()).into(holder.imageView);
How do I convert this code?
private Bitmap displayPdfPage(String pdfFilePath) throws IOException {
ParcelFileDescriptor fileDescriptor = ParcelFileDescriptor.open(new File(pdfFilePath), ParcelFileDescriptor.MODE_READ_ONLY);
PdfRenderer pdfRenderer = new PdfRenderer(fileDescriptor);
PdfRenderer.Page page = pdfRenderer.openPage(0);
Bitmap pageBitmap = Bitmap.createBitmap(page.getWidth(), page.getHeight(), Bitmap.Config.ARGB_8888);
page.render(pageBitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
page.close();
pdfRenderer.close();
return pageBitmap;
}
Use the above function to get pdf image but make sure to download the pdf file first and then parse the downloaded file path to the above function and it will return the first page of the pdf as bitmap.
@@EverydayProgrammer You need to display the pdf image in Firebase
How about image sir
There you go: ruclips.net/video/ICK9g66Ba5E/видео.html
😍