如何在屏幕旋转后停止android打印框架对话框关闭?

问题描述:

我在Android应用程序中编写一个Printer类,一切运行良好,直到我旋转屏幕,纵向模式下屏幕顶部的打印选项对话框将关闭,我想维护打印框架对话框,我尝试设置android:configChange但它没有帮助。任何帮助?如何在屏幕旋转后停止android打印框架对话框关闭?

我发现PrintManager代码此评论,

Calling this method will bring the print dialog and 
* the system will connect to the provided {@link PrintDocumentAdapter}. If a 
* configuration change occurs that you application does not handle, for example 
* a rotation change, the system will drop the connection to the adapter as the 
* activity has to be recreated and the old adapter may be invalid in this context, 
* hence a new adapter instance is required. As a consequence, if your activity 
* does not handle configuration changes (default behavior), you have to save the 
* state that you were printing and call this method again when your activity 
* is recreated.