AndroidPdfViewer
AndroidPdfViewer copied to clipboard
Rotate screen problem
when i rotate my phone, the screen turn white.The view is not draw again.how do i solve it??
Post some code, i use the .onLoad( to resize on orientation as this event is driven on orientation change as the pdf is reloaded to display.
@1stmetro
pdfView.fromUri(Uri.fromFile(pdf))
.defaultPage(lastPageIndex)
.onPageChange(this)
.enableSwipe(true)
.swipeHorizontal(false)
.enableAnnotationRendering(true)
.scrollHandle(new DefaultScrollHandle(this))
.onLoad(this)
.load();
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
hideToolbar();
if (pdfComment != null)
pdfComment.setVisibility(View.GONE);
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
showToolbar();
if (pdfComment != null && !isLocal)
pdfComment.setVisibility(View.VISIBLE);
this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
<activity
android:name="com.lecai.activity.PDFViewActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleTask" />
It can not reload when i rotate my phone.
Any update on this how to fix roation issue