Disable split screen android

Good afternoon,

I would like to disable the split screen and get the result, which is shown in the "Expected Result" screenshot. (Toast with text "Application does not support split screen")

On the Actual Result screen, you can see how it android:resizeableActivity="false"affects the application, but split-screen mode is turned on. How can I disable it altogether?

Actual result:

enter image description here Expected Result:

enter image description here

+4
source share
3 answers

What did i find?

We cannot set android:resizeableActivity="false"to a tag <application>; it is ignored. (Google documentation error)

It works when I set it to the main action

 <activity
        android:name=".activities.SplashScreenActivity"
        android:label="@string/app_name"
        android:theme="@style/splashScreenTheme"
        android:resizeableActivity="false">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

    </activity>
+9

minHeight miWidth, :

<activity android:name=".MyActivity">
<layout android:defaultHeight="500dp"
      android:defaultWidth="600dp"
      android:gravity="top|end"
      android:minHeight="450dp"
      android:minWidth="300dp" />
</activity>

: https://developer.android.com/guide/topics/ui/multi-window.html

0

Add android: resizeableActivity = "false" in the application tag in the manifest.xml file.

         <application
                android:name=".activity.MyApplication"
                android:allowBackup="true"
                android:icon="@drawable/btn_share_myapplication"
                android:label="@string/app_name"
                android:resizeableActivity="false"
                android:supportsRtl="true"
                android:theme="@style/AppTheme">
                <activity
                    android:name=".activity.SplashActivity"
                    android:screenOrientation="portrait">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN" />
                        <category android:name="android.intent.category.LAUNCHER" />
                    </intent-filter>
                </activity>
        <activity... />
        </application>
0
source

Source: https://habr.com/ru/post/1658909/


All Articles