1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 3 Copyright 2013 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16 --> 17 18 <sample> 19 <name>MultiWindowPlayground</name> 20 <group>Android N Preview</group> 21 <package>com.example.android.multiwindowplayground</package> 22 23 <minSdk>24</minSdk> 24 <compileSdkVersion>24</compileSdkVersion> 25 <targetSdkVersion>24</targetSdkVersion> 26 27 <strings> 28 <intro> 29 <![CDATA[ 30 This sample demonstrates the use of the multi-window API available 31 in Android N. It shows the use of new Intent flags and 32 AndroidManifest properties to define the multi-window behavior. 33 Switch the sample app into multi-window mode to see how it affects 34 the lifecycle and behavior of the app. 35 ]]> 36 </intro> 37 </strings> 38 39 <template src="base-build" /> 40 41 <metadata> 42 <status>PUBLISHED</status> 43 <categories>Android N Preview</categories> 44 <technologies>Android</technologies> 45 <languages>Java</languages> 46 <solutions>Mobile</solutions> 47 <level>INTERMEDIATE</level> 48 <!-- Dimensions: 512x512, PNG fomrat --> 49 <icon>screenshots/icon-web.png</icon> 50 <!-- Path to screenshots. Use <img> tags for each. --> 51 <screenshots> 52 <img>screenshots/main.png</img> 53 </screenshots> 54 <api_refs> 55 <android>android.content.Intent</android> 56 <android>android.app.ActivityOptions</android> 57 </api_refs> 58 <description> 59 <![CDATA[ 60 This sample demonstrates the use of the multi-window API available 61 in Android N. It shows the use of new Intent flags and 62 AndroidManifest properties to define the multi-window behavior. 63 Switch the sample app into multi-window mode to see how it affects 64 the lifecycle and behavior of the app. 65 ]]> 66 </description> 67 68 <intro> 69 <![CDATA[ 70 Android N introduces new APIs to support multiple activities 71 to be displayed at the same time. 72 73 Activities that are started within the same task stack 74 inherit their multiwindow properties from the activity that fired 75 off the intent. The following features are available when an activity 76 has been launched into a new task stack. 77 78 An activity can be set as not resizable through the 79 `android:resizableActivity` property in the AndroidManifest. All 80 applications targeting Android N or above are resizable by default. 81 82 In split-screen mode, an activity can be started adjacent to the 83 launching activity by setting the 84 `Intent.FLAG_ACTIVITY_LAUNCH_TO_ADJACENT` flag in its intent. 85 86 Sometimes activities may choose to handle configuration changes 87 themselves (for example for games or OpenGL-based applications). In this 88 case, setting 89 `android:configChanges=screenSize|smallestScreenSize|screenLayout|orientation` 90 in the AndroidManifest definition of the activity enables callbacks for 91 all configuration changes that may occur during multi-window use for the 92 Activity. See [Handling Runtime Changes][1]. 93 94 In freeform mode (where applications can be freely resized), activities 95 can be started within a certain area of the screen using the 96 `ActivityOptions#setLaunchBounds` call. 97 98 Alternatively, the preferred and minimum sizes can be set in a new 99 `layout` property in the AndroidManifest. 100 101 102 [1]: https://developer.android.com/guide/topics/resources/runtime-changes.html 103 ]]> 104 </intro> 105 </metadata> 106 </sample> 107