suchen

Heim  >  Fragen und Antworten  >  Hauptteil

weex页面跳转到其他页面时 android端出现问题

在weex页面通过navigator.push 的方式跳转页面,uri地址正确;在android端报错;
求解

04-12 16:53:16.732 31900-31900/com.weex.sample E/Navigator: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[com.taobao.android.intent.category.WEEX] dat=http://192.168.2.31:8080/dist... (has extras) }

    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1846)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1566)
    at android.app.Activity.startActivityForResult(Activity.java:3830)
    at android.app.Activity.startActivityForResult(Activity.java:3787)
    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:842)
    at android.app.Activity.startActivity(Activity.java:4139)
    at android.app.Activity.startActivity(Activity.java:4069)
    at com.taobao.weex.appfram.navigator.WXNavigatorModule.push(WXNavigatorModule.java:224)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.taobao.weex.bridge.MethodInvoker.invoke(MethodInvoker.java:232)
    at com.taobao.weex.bridge.NativeInvokeHelper$1.run(NativeInvokeHelper.java:234)
    at com.taobao.weex.common.WXThread$SafeRunnable.run(WXThread.java:234)
    at android.os.Handler.handleCallback(Handler.java:815)
    at android.os.Handler.dispatchMessage(Handler.java:104)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5869)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1019)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:814)
PHP中文网PHP中文网2813 Tage vor1038

Antworte allen(1)Ich werde antworten

  • PHP中文网

    PHP中文网2017-04-18 09:21:06

    navigator.push在android底层是通过startActivity的方式来切换实例的。这个错误是因为在AndroidManifest.xml中没有配置拦截器,可以尝试这样:

    <activity
                android:name="com.bingo.weex.core.BingoWXPageActivity"
                android:screenOrientation="portrait">
                <intent-filter>
                    <action android:name="com.taobao.android.intent.action.WEEX" />
                    <category android:name="android.intent.category.DEFAULT" />
                    <category android:name="com.taobao.android.intent.category.WEEX" />
                    <action android:name="android.intent.action.VIEW" />
                    <data android:scheme="http" />
                    <data android:scheme="https" />
                    <data android:scheme="file" />
                    <data android:scheme="wxpage" />
                </intent-filter>
            </activity>

    注意android:name修改成自己的Activity即可,观察下actioncategory估计就明白了

    Antwort
    0
  • StornierenAntwort