In the android developers site they say:
If you set resizeableActivity=false to disable multi-window mode but still want to support app continuity, add the following meta-data to the manifest of your element:
<meta-data android:name="android.supports_size_changes" android:value="true" />
If the value is true and the user attempts to fold or unfold a device, the activity will apply any changed configurations in a way that supports changes in window sizes.
So I did as they said but the activity isn't automatically resumed when I test it in the emulator. here is my code:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:resizeableActivity="false"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/MaterialTheme">
<meta-data
android:name="android.supports_size_changes" android:value="true" />
</application>
Did I do anything wrong?
We have updated the developer documentation for multi-window support to clarify how to control your app's support for preventing your app from running in multi‑window mode.
The primary way of accomplishing this is by setting
resizeableActivity="false"
, but note that there are more refined ways of controlling this behavior by setting minimum size constraints, and that device manufacturers can override these behaviors.