Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable multi window feature programmatically

I am trying to disable multi window feature of android. I have read the android documentation and know that resizeableActivity would only work for android N (API level 24) but I want to disable it on lower level android APIs. As Samsung devices have multi window feature on its all device (approx). So I have to disable it.

like image 540
Awais Avatar asked Mar 20 '17 14:03

Awais


People also ask

How do I close multi window on Android?

Another way to exit multi-window mode is to long-press the “recent apps” button until the secondary app closes, leaving you with only the primary app open in single-window mode.

What is multi window mode Android?

Multi-window mode enables multiple apps to share the same screen simultaneously. Apps can be side by side or one above the other (split-screen mode), one app in a small window overlaying other apps (picture-in-picture mode), or individual apps in separate movable, resizable windows (free-form mode).

What is multi window UI?

Multi-window's default experience is split-screen mode, where the System UI is divided down the middle of the device in portrait or landscape. Users can resize the window by dragging the dividing line side to side or top to bottom, depending on the device orientation.


1 Answers

You cannot do that in runtime. Your application either supports multi window mode, or it doesn't. Parameters, that are given in AndroidManifest.xml cannot be changed during runtime.

From the documentation of android:resizeableActivity:

If this attribute is set to true, the activity can be launched in split-screen and freeform modes. If the attribute is set to false, the activity does not support multi-window mode. If this value is false, and the user attempts to launch the activity in multi-window mode, the activity takes over the full screen.

For specifically Samsung devices you can try putting this in manifest file:

<meta-data android:name="com.sec.android.support.multiwindow" android:value="false" />
<meta-data android:name="com.samsung.android.sdk.multiwindow.multiinstance.enable"
            android:value="false" />
<meta-data android:name="com.samsung.android.sdk.multiwindow.penwindow.enable" 
            android:value="false" />
like image 169
azizbekian Avatar answered Sep 28 '22 15:09

azizbekian