Android – don’t ignore the dialog box when the screen orientation changes

I created a custom label activity with two different vertical and horizontal drawings. The icon of the vertical screen is under drawable hdpi and the landscape image is under drawable land hdpi. So far, I have placed configuration changes in the list to maintain the visibility of the dialog box

android:configChanges="orientation"

Whenever the dialog box is displayed and the user changes the direction from vertical to horizontal, the dialog box will still be displayed, but the image it uses in the tab activity is used in vertical mode. That's why the layout doesn't look correct because it doesn't use drawables as the landscape. Can someone help me? thank you.

resolvent:

If you use Android: configchanges = "orientation", Android will not recreate the activity when the direction changes. If you do not want to dismiss the dialog box, please use the activity. Showdialog() method. If you still want to use Android: configchanges = "orientation", you must manually change the drawable in the activity. Onconfigurationchanged() method

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>