Open csharsha opened 9 years ago
Did you find a solution to this?
I just tried to modify the source code for fragment, but pdf content is not displayed instead a black screen is displayed in fragment area.
Anyone solved this problem?
Since "this" doesnt work in a fragment we have to use "getActivity()" instead. Similarly "getFilesDir()" has to be preceded with "getActivity()". I got my code working through this.
Here is the code to use with fragment -
Intent intent = new Intent(getActivity(), PdfViewer.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, getActivity().getFilesDir() + "/chapter.pdf"); startActivity(intent);
I'm using this inside fragment without any problems. using PDFView in my fragments layout and then calling the load from assets as described in sample in my onViewCreated method
Hi, How can I use this library with Fragment. I have gone through the source code, current code only supports only Activity. Please help me to achieve the same with Fragment.
Thanks