1*d353a188SXin Li 2*d353a188SXin LiAndroid MultiWindowPlayground Sample 3*d353a188SXin Li=================================== 4*d353a188SXin Li 5*d353a188SXin LiThis sample demonstrates the use of the multi-window API available 6*d353a188SXin Liin Android N. It shows the use of new Intent flags and 7*d353a188SXin LiAndroidManifest properties to define the multi-window behavior. 8*d353a188SXin LiSwitch the sample app into multi-window mode to see how it affects 9*d353a188SXin Lithe lifecycle and behavior of the app. 10*d353a188SXin Li 11*d353a188SXin LiIntroduction 12*d353a188SXin Li------------ 13*d353a188SXin Li 14*d353a188SXin LiAndroid N introduces new APIs to support multiple activities 15*d353a188SXin Lito be displayed at the same time. 16*d353a188SXin Li 17*d353a188SXin LiActivities that are started within the same task stack 18*d353a188SXin Liinherit their multiwindow properties from the activity that fired 19*d353a188SXin Lioff the intent. The following features are available when an activity 20*d353a188SXin Lihas been launched into a new task stack. 21*d353a188SXin Li 22*d353a188SXin LiAn activity can be set as not resizable through the 23*d353a188SXin Li`android:resizableActivity` property in the AndroidManifest. All 24*d353a188SXin Liapplications targeting Android N or above are resizable by default. 25*d353a188SXin Li 26*d353a188SXin LiIn split-screen mode, an activity can be started adjacent to the 27*d353a188SXin Lilaunching activity by setting the 28*d353a188SXin Li`Intent.FLAG_ACTIVITY_LAUNCH_TO_ADJACENT` flag in its intent. 29*d353a188SXin Li 30*d353a188SXin LiSometimes activities may choose to handle configuration changes 31*d353a188SXin Lithemselves (for example for games or OpenGL-based applications). In this 32*d353a188SXin Licase, setting 33*d353a188SXin Li`android:configChanges=screenSize|smallestScreenSize|screenLayout|orientation` 34*d353a188SXin Liin the AndroidManifest definition of the activity enables callbacks for 35*d353a188SXin Liall configuration changes that may occur during multi-window use for the 36*d353a188SXin LiActivity. See [Handling Runtime Changes][1]. 37*d353a188SXin Li 38*d353a188SXin LiIn freeform mode (where applications can be freely resized), activities 39*d353a188SXin Lican be started within a certain area of the screen using the 40*d353a188SXin Li`ActivityOptions#setLaunchBounds` call. 41*d353a188SXin Li 42*d353a188SXin LiAlternatively, the preferred and minimum sizes can be set in a new 43*d353a188SXin Li`layout` property in the AndroidManifest. 44*d353a188SXin Li 45*d353a188SXin Li 46*d353a188SXin Li[1]: https://developer.android.com/guide/topics/resources/runtime-changes.html 47*d353a188SXin Li 48*d353a188SXin LiPre-requisites 49*d353a188SXin Li-------------- 50*d353a188SXin Li 51*d353a188SXin Li- Android SDK 24 52*d353a188SXin Li- Android Build Tools v27.0.2 53*d353a188SXin Li- Android Support Repository 54*d353a188SXin Li 55*d353a188SXin LiScreenshots 56*d353a188SXin Li------------- 57*d353a188SXin Li 58*d353a188SXin Li<img src="screenshots/main.png" height="400" alt="Screenshot"/> 59*d353a188SXin Li 60*d353a188SXin LiGetting Started 61*d353a188SXin Li--------------- 62*d353a188SXin Li 63*d353a188SXin LiThis sample uses the Gradle build system. To build this project, use the 64*d353a188SXin Li"gradlew build" command or use "Import Project" in Android Studio. 65*d353a188SXin Li 66*d353a188SXin LiSupport 67*d353a188SXin Li------- 68*d353a188SXin Li 69*d353a188SXin Li- Google+ Community: https://plus.google.com/communities/105153134372062985968 70*d353a188SXin Li- Stack Overflow: http://stackoverflow.com/questions/tagged/android 71*d353a188SXin Li 72*d353a188SXin LiIf you've found an error in this sample, please file an issue: 73*d353a188SXin Lihttps://github.com/googlesamples/android-MultiWindowPlayground 74*d353a188SXin Li 75*d353a188SXin LiPatches are encouraged, and may be submitted by forking this project and 76*d353a188SXin Lisubmitting a pull request through GitHub. Please see CONTRIBUTING.md for more details. 77*d353a188SXin Li 78*d353a188SXin LiLicense 79*d353a188SXin Li------- 80*d353a188SXin Li 81*d353a188SXin LiCopyright 2017 The Android Open Source Project, Inc. 82*d353a188SXin Li 83*d353a188SXin LiLicensed to the Apache Software Foundation (ASF) under one or more contributor 84*d353a188SXin Lilicense agreements. See the NOTICE file distributed with this work for 85*d353a188SXin Liadditional information regarding copyright ownership. The ASF licenses this 86*d353a188SXin Lifile to you under the Apache License, Version 2.0 (the "License"); you may not 87*d353a188SXin Liuse this file except in compliance with the License. You may obtain a copy of 88*d353a188SXin Lithe License at 89*d353a188SXin Li 90*d353a188SXin Lihttp://www.apache.org/licenses/LICENSE-2.0 91*d353a188SXin Li 92*d353a188SXin LiUnless required by applicable law or agreed to in writing, software 93*d353a188SXin Lidistributed under the License is distributed on an "AS IS" BASIS, WITHOUT 94*d353a188SXin LiWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 95*d353a188SXin LiLicense for the specific language governing permissions and limitations under 96*d353a188SXin Lithe License. 97