Appium does not return all android page source

Hello every one,

from the second.jpeg, appium could not return the right side page source while executing get source
only return the left side page source,

but in the second.jpeg, both left side and right side are on the same app with the same activity.

How to fix it? (This issue also create in https://github.com/appium/appium-uiautomator2-server/issues/448)

first.log is the page source of first.jpeg
first.log (41.5 KB)

second.log is the page source of second.jpeg
second.log (28.0 KB)

try add to capability:

capabilities.setCapability("enableMultiWindows", true);

@Aleksei
Great! That exact help me fix the issue, thank you!