【问题标题】:How to receive data from the send intent?如何从发送意图接收数据?
【发布时间】:2014-03-20 10:06:52
【问题描述】:

如何在基于 Adob​​e Air 的 Android 应用程序中接收来自send intent 的数据?

我尝试了下面的方法,但是传入的参数数组和事件为空,共享内容丢失。

这是我的 Air 源文件和一个测试 .apk 文件,如果有人能看一下就好了。

空气:

import flash.desktop.NativeApplication;
import flash.events.InvokeEvent;

NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
NativeApplication.nativeApplication.addEventListener(BrowserInvokeEvent.BROWSER_INVOKE, onBrowserInvoke);

function onInvoke(event:InvokeEvent):void
{
trace("\n Invoke event: " + event)
}

function onBrowserInvoke(event:BrowserInvokeEvent):void
{
trace("\n Browser Invoke event: " + event)
}

XML(app.xml 清单):

<android> 
    <manifestAdditions> 
      <![CDATA[ 
               <manifest>
<uses-permission android:name="android.permission.INTERNET"/>
   <application>
     <activity>
<intent-filter>
                        <action android:name="android.intent.action.MAIN"/>
                        <category android:name="android.intent.category.LAUNCHER"/>
                    </intent-filter>
                    <intent-filter>
                        <action android:name="android.intent.action.VIEW"/>
                        <category android:name="android.intent.category.BROWSABLE"/>
                        <category android:name="android.intent.category.DEFAULT"/>
                        <data android:scheme="helloworld"/>
                    </intent-filter>
                <intent-filter> 
        <action android:name="android.intent.action.SEND"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <data android:mimeType="text/plain"/>
    </intent-filter>
                        </activity>
            </application>   
        </manifest>
    ]]>
    </manifestAdditions> 
  </android>

【问题讨论】:

  • 在 adobe 论坛中也有同样的问题:forums.adobe.com/message/5477286 希望你能在那里找到有用的东西,我试图打开你的项目,但我的 flash builder 4.6 在打开它时崩溃:s
  • 问题解决了吗?我得到了同样的行为......
  • 是的,我用原生扩展解决了这个问题。
  • 您是构建了 ANE 还是使用了第 3 方?可以的话,可以分享一下吗?
  • @NemoStein 你的电子邮件是什么?我可以私下给你发详细信息。

标签: android android-intent air


【解决方案1】:

我建议使用结构体从本机扩展返回你想要的数据,详情见this answer

【讨论】:

  • 这个答案没有任何意义... =|
  • 这是一种将数据从android(使用本机扩展)发送到air的方式。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-06-09
  • 1970-01-01
  • 1970-01-01
  • 2014-05-16
  • 2021-12-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多