如何从 send intent 接收数据在基于 Adobe Air 的 Android 应用程序中?
我按照下面的方法试过了,但是传入的参数数组和事件都是空的,共享的内容也不见了。
这是我的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 list ):
<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>
最佳答案
我建议使用结构从 native 扩展返回您想要的数据,请参阅 this answer了解详情。
关于android - 如何从发送 Intent 接收数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21891295/