0

我正在使用 Adob​​e Air 3.6 和 Flash CS 6 构建 Android 应用程序。是否可以从其他应用程序接收内容,例如来自浏览器的链接?

我在任何地方都找不到一个可行的例子。

4

1 回答 1

0

您可以在应用描述符的适当部分添加您需要的所有意图。查找与 android 相关的部分:

...
<android>
        <manifestAdditions>
        <![CDATA[
            <manifest android:installLocation="auto">
                <uses-permission android:name="android.permission.INTERNET"/>
                <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
                <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
                <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
                <application android:enabled="true">
                    <activity android:excludeFromRecents="false">
                        <intent-filter>
                            <action android:name="android.intent.action.MAIN"/>
                            <category android:name="android.intent.category.LAUNCHER"/>
                        </intent-filter>

                                    <!-- ADD INTENTS HERE -->

                    </activity>
                </application>
            </manifest>
        ]]>
        </manifestAdditions>
        <!-- Color depth for the app (either "32bit" or "16bit"). Optional. Default 16bit before namespace 3.0, 32bit after -->
        <!-- <colorDepth></colorDepth> -->
</android>
...

请注意,这只是故事的一半。为了正确使用这些意图,您应该在代码中处理它们,如下所示:

NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE,onInvoke);
...
function onInvoke(event:InvokeEvent):void
{
  /* handle your intent here */
}

请参阅此处的官方文档。

于 2013-05-13T14:17:36.023 回答