Viewing 1 post (of 1 total)
  • Author
    Posts
  • #11373 Reply

    Karuna

    I have integrated plugpdf code in my android fragment to be able to display pdf. Following is my code.

    I can open the pdf using the above code. The problem is when I click on back, my app crashes with an error.
    “No view found for id 0x7f0d0070”

    I have integrated plugpdf code in my android fragment to be able to display pdf. Following is my code

    private SimpleDocumentReader viewer;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    super.onCreate(null);
    getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    View rootView = inflater.inflate(R.layout.fragment_pdf_viewer, container, false);
    Bundle bundle = getArguments();
    String documentUrl = bundle.getString(“DOC_URL”);
    String documentTitle = bundle.getString(“DOC_TITLE”);
    initializePDFPlug();
    viewer = SimpleReaderFactory.createSimpleViewer(this.getActivity(), listener);
    viewer.openUrl(documentUrl, “”);
    viewer.setTitle(documentTitle);

    return rootView;
    }

    private SimpleDocumentReaderListener listener = new SimpleDocumentReaderListener() {
    @Override
    public void onLoadFinish(DocumentState.OPEN state) {
    Log.i(“PlugPDF”, “[INFO] Open ” + state);
    }
    };
    I can open the pdf using the above code. The problem is when I click on back, my app crashes with an error.

    “No view found for id 0x7f0d0070”
    If I comment out the plugpdf code then it works fine. I can click back and go to previous screen. With the above code, it crashes if I click on back to go to previous screen. The above code is in a fragment. Please suggest some ideas.

Viewing 1 post (of 1 total)
Reply To: android integration with plugpdf
Your information: