Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
851 views
in Technique[技术] by (71.8m points)

multi window - How can I disable multiwindow mode for an Activity in Android N+

In the developer preview for Android N, multi-window support is enabled by default. How can I disable it for activites? Also what will happen if a multi-window enabled app launches my disabled activity?

question from:https://stackoverflow.com/questions/37311145/how-can-i-disable-multiwindow-mode-for-an-activity-in-android-n

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In your manifest, you need:

android:resizeableActivity="false"

So in your manifest file, for each activity that you want to disable the feature in, it would be like:

<activity android:name=".SomeActivity"
    android:label="@string/app_name"
    android:resizeableActivity="false" />

Or, if you want to disable it in your entire app:

<application 
   android:resizeableActivity="false" >
    . . .
</application>

As for what will happen, Android just won't let your app go into multi-screen mode - it will just stay full screen. See https://developer.android.com/preview/features/multi-window.html and https://developer.android.com/guide/topics/manifest/activity-element.html#resizeableActivity.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...