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.
Asked
Active
Viewed 8,521 times
5
-
Samsung MultiWindow has different way to set! so why do you need to disable it? – Elias Fazel Mar 20 '17 at 14:15
-
I got this requirement for an enterprise application. So, I need to disable it. – Awais Mar 21 '17 at 05:33
2 Answers
7
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" />

azizbekian
- 60,783
- 13
- 169
- 249
-
Yes I read the documentation as I mentioned. But android:resizeableActivity="false" would work on API level 24 and above. I need to disable this feature on lower level also. – Awais Mar 21 '17 at 05:30
-
1@Awais, `I need to disable this feature on lower level also` that feature won't work on API lower than 24, which means it's disabled by default. – azizbekian Mar 21 '17 at 05:49
-
I tried your suggestions but it is not working. Kindly get the snapshot which I added after trying it. – Awais Mar 21 '17 at 11:14
-
-
-
You don't need anything else then 'android:resizeableActivity="false"' and targetSdkVersion at least 24. Don't worry about "Attribute resizeableActivity is only used in API level 24 and higher". AndroidManifest never cause crash for version error, it dismiss attribute for lower versions – OMArikan Oct 17 '17 at 07:46
-
-
-
@azizbekian adb is not on runtime: [link](https://developer.android.com/studio/command-line/adb.html) – Benjamin Lucidarme Dec 13 '17 at 12:55
-
@BenjaminLucidarme, what do you mean by saying "can we do it from adb"? – azizbekian Dec 13 '17 at 13:01
-
@azizbekian, is it possible to disable multi window from adb? – Benjamin Lucidarme Dec 13 '17 at 13:14
-
-
1for those who have the same problem as me, the solution is: `adb shell settings put system multi_window_enabled 0` – Benjamin Lucidarme Dec 14 '17 at 15:49
-
@BenjaminLucidarme it's not work when i send apk for other persion without using this line – famfamfam Oct 19 '20 at 01:32
0
After many attempts I could only do so on the lollipop!!! @Awais
Settings.System.putInt(this.context.getContentResolver(), multi_window_enabled", 0 );

Laurenz Albe
- 209,280
- 17
- 206
- 263