Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blank PDF after app returns from background mode. #129

Open
tomerlevi444 opened this issue Oct 30, 2016 · 2 comments
Open

blank PDF after app returns from background mode. #129

tomerlevi444 opened this issue Oct 30, 2016 · 2 comments

Comments

@tomerlevi444
Copy link

tomerlevi444 commented Oct 30, 2016

When app switches to background mode, PDFView.onDetachedFromWindow might be called which causes the pdf to recycle and clear all of its contents.
Then, when app returns to foreground, the pdf appears blank.

This happens when pdf is located inside a Dialog, for example.

@vahidarr
Copy link

It happens for me too

@vahidarr
Copy link

this work in Activity but not work in Dialog.this is dialog Code:

public class PdfViewerModal extends Dialog {
    public PdfViewerModal(@NonNull Context context) {
        super(context);
        View mainView = LayoutInflater.from(context).inflate(R.layout.modal_pdf_viewer, null);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        addContentView(mainView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));

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

        pdfView.fromAsset("asan.pdf").load();
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants