【问题标题】:Support for Multi Window App Development支持多窗口应用程序开发
【发布时间】:2013-07-07 15:30:46
【问题描述】:

应用程序开发人员可以为任何运行 android 的设备开发多窗口应用程序吗?我不确定是否只有安卓操作系统(某些版本)支持这个?还是只有三星专有? 如果它可以为任何运行 android 的设备开发,关于如何开始做的建议?

【问题讨论】:

    标签: android multi-window


    【解决方案1】:

    任何人都可以做到。您的活动屏幕区域刚刚缩小。

    您可以使用资源限定符为此类实例选择不同的布局。 见:http://developer.android.com/guide/topics/resources/providing-resources.html#ScreenHeightQualifier

    这是一个支持多窗口支持的 AndroidManifest.xml 示例。

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.multiwintest"
        android:versionCode="1" android:versionName="1.0"
        >
    
        <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
    
        <application
            android:allowBackup="true" android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" android:theme="@style/AppTheme"
            >
            <uses-library android:name="com.sec.android.app.multiwindow" android:required="false" />
            <meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
            <activity android:name=".MainActivity" android:label="@string/app_name" >
                <intent-filter>
                    <action   android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                    <category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    </manifest>
    

    这仅适用于三星专用版本。

    read the docs here 获取官方 Android 7.0 (APIv24) 支持。

    【讨论】:

    • 你是说同时运行(比如说)两个应用程序(比如说一个在屏幕的上半部分运行,另一个在屏幕的下半部分运行)??我指的是这种情况。
    • 我已经编辑了我的答案以包含一个带有更改的示例清单文件,以便 FlashBarService 可以将您的应用检测为启用了多窗口。
    猜你喜欢
    • 1970-01-01
    • 2020-11-17
    • 2012-12-16
    • 1970-01-01
    • 1970-01-01
    • 2019-11-12
    • 1970-01-01
    • 2012-10-28
    • 2017-06-06
    相关资源
    最近更新 更多