Support for multiple windows on Android was first popularized by Samsung, but the feature slowly made its way into Android. Android 6.0 Marshmallow introduced split-screen multi-window support while Android 7.0 Nougat quietly added freeform window support, although unlocking freeform window support required either an ADB command or enabling a Developer Option. Unfortunately, with the release of the first Android P Developer Preview, it seemed that freeform window support was removed because the traditional methods used to enable it no longer worked. Thankfully, there’s now a workaround to bring back freeform window support on Android Pie devices, and it doesn’t need root!
Android Pie seems to have done away with the concept of “stacks” of windows, and instead introduces something called a WindowConfiguration…Each app window can have a specific windowing mode assigned to it. Freeform windows are just one of the various windowing modes listed. When starting an activity, you can set it to use any windowing mode you want by calling this method (using reflection).
Thus, why the earlier version of Taskbar could no longer launch freeform windows was that Android changed how app window modes are determined. With the source code now being available, farmerbb was able to figure out how to launch freeform windows using the new methods. As he explains:
You can either:
Start an activity supplying an ActivityOptions bundle with the setLaunchWindowingMode method called via reflection (requires targetSdk of 27 or earlier, otherwise you’ll run into the non-SDK interface restrictions here.
Or, run the am start-activity command via adb with the –windowingMode parameter supplied, for example: adb shell am start-activity –windowingMode 5 com.farmerbb.taskbar/.MainActivity
farmerbb chose the first way, so, for now, the app’s targetSdkVersion is 27 and not 28. Once he’s forced to bump the targetSdkVersion to 28, he’ll have to use a workaround that I recommended (if that still works by then.) We’ll cross that bridge when we get to that point, though.
Bring Back Freeform Windows on Android Pie
If you are interested in getting freeform windows on your Android 9 Pie device, then all you have to do is install the latest version of the Taskbar app from the Google Play Store. The latest version, 4.0, is already available. Just install the app and enable freeform mode in the app after following the setup instructions. If you’ve used the app to launch freeform windows in the past, you’ll notice one immediate difference between the previous implementation and how it now works in Android Pie. I’ll let farmerbb explain:
A side effect of this change is that now freeform windows can float on top of fullscreen windows, instead of being limited to their own stack! Pretty cool change, although you can’t keep them pinned on top of the window hierarchy like PIP windows can.