0

我只是想使用 AS3 为 android 做一些事情,但我无法让它工作。

我试图通过内部 url 调用意图。即在我的应用程序中,我想调用 myapp://com.android.myapp 并且应该调用特定的意图。

这是清单上定义的意图:

      <receiver android:name="com.myapp.CustomReceiver">
        <intent-filter>
          <action android:name="android.intent.action.VIEW" />
          <data android:scheme="myapp" android:host="com.android.myapp"/>
        </intent-filter>
      </receiver>

我已经使用 onReceive 函数声明了 CustomReceiver。

然后在 AS3 上我试图通过

      navigateToUrl(new URLRequest("myapp://com.android.myapp"));

但是意图永远不会被调用,你能帮我理解什么是错的吗?

谢谢

4

1 回答 1

0

我认为您需要像这样定义意图过滤器:

<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="myapp"/> 
</intent-filter>

来源:http ://dreamingwell.com/articles/archives/2011/06/flex-mobile-cus-2.php

于 2013-10-16T21:03:56.443 回答