How can I disable multiwindow mode for an Activity in Android N+

后端 未结 3 1042
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-02 07:00

In the developer preview for Android N, multi-window support is enabled by default. How can I disable it for activites? Also what will happen if a multi-window enabled app lau

相关标签:
3条回答
  • 2021-02-02 07:31

    By the way, I added android:resizeableActivity="false" to Manifest and then I switched language with Locale some Activities didn't change language. I noticed some activities have different resources. When I remove resizebleActivity property in Manifest it works OK.

    0 讨论(0)
  • 2021-02-02 07:40

    Note: While starting a Unresizable Activity You should also add Intent.FLAG_ACTIVITY_NEW_TASK flag to Intent.Otherwise it will inherit the properties from the root activity.

    Add android:resizeableActivity="false" for your Activity in your Manifest file or you can also add this for your Application:

    <activity android:name=".YourActivity"
    android:label="@string/app_name"
    android:resizeableActivity="false" />
    
    0 讨论(0)
  • 2021-02-02 07:48

    In your manifest, you need:

    android:resizeableActivity="false"
    

    So in your manifest file, for each activity that you want to disable the feature in, it would be like:

    <activity android:name=".SomeActivity"
        android:label="@string/app_name"
        android:resizeableActivity="false" />
    

    Or, if you want to disable it in your entire app:

    <application 
       android:resizeableActivity="false" >
        . . .
    </application>
    

    As for what will happen, Android just won't let your app go into multi-screen mode - it will just stay full screen. See https://developer.android.com/preview/features/multi-window.html and https://developer.android.com/guide/topics/manifest/activity-element.html#resizeableActivity.

    0 讨论(0)
提交回复
热议问题