Disable split screen android

安稳与你 提交于 2019-11-30 06:58:57

What I found ?

We can't set android:resizeableActivity="false" in the <application> tag it is ignored. (mistake google documentation)

It works when I set it to the main activity

 <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>

Add android:resizeableActivity="false" in application tag at 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>

Try to set minHeight and miWidth as in example here:

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!