Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 launches my disabled activity?

like image 484
Patrick Avatar asked May 18 '16 22:05

Patrick


People also ask

How do I turn off multi window mode on Android?

There is an app “MultiWindow Toggle for Samsung” available on Google Play that allows you to turn the multi-window mode off/on using a toggle button. It also has an option for adding the Multi window Quick Toggle to the notification drawer for quicker access.

What is multi screen activity android?

Multi-display. Android 10 (API level 29) supports activities on secondary displays. If an activity is running on a device with multiple displays, users can move the activity from one display to another. Multi-resume applies to multi-screen scenarios as well; several activities can receive user input at the same time.


1 Answers

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.

like image 102
Tomer Shemesh Avatar answered Sep 21 '22 02:09

Tomer Shemesh