• cocos2d-x嵌入移动MM短代支付IAP2.4的SDK,点击支付崩溃的解决的方法


    凡是用IAP2.4,调用purchase.order 游戏崩溃。logcat报错是:

    06-16 18:43:42.944: E/AndroidRuntime(8526): FATAL EXCEPTION: main
    06-16 18:43:42.944: E/AndroidRuntime(8526): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.xxx.xxx.com.mmiap.activity (has extras) }
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1671)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1441)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.app.Activity.startActivityForResult(Activity.java:3464)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.app.Activity.startActivityForResult(Activity.java:3425)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.app.Activity.startActivity(Activity.java:3661)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.app.Activity.startActivity(Activity.java:3629)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at mm.purchasesdk.Purchase.a(Unknown Source)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at mm.purchasesdk.a.a(Unknown Source)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at mm.purchasesdk.b.handleMessage(Unknown Source)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.os.Handler.dispatchMessage(Handler.java:99)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.os.Looper.loop(Looper.java:176)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at android.app.ActivityThread.main(ActivityThread.java:5493)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at java.lang.reflect.Method.invokeNative(Native Method)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at java.lang.reflect.Method.invoke(Method.java:525)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041)
    06-16 18:43:42.944: E/AndroidRuntime(8526): at dalvik.system.NativeStart.main(Native Method)



    解决的方法,改动proj.android/AndroidManifest.xml。把从DEMO里面拷贝过来的这段:
    <activity
                android:name="mm.purchasesdk.iapservice.BillingLayoutActivity"
                android:configChanges="orientation|keyboardHidden"
                android:theme="@android:style/Theme.Translucent" >
                <intent-filter android:priority="240" >
                    <action android:name="com.xxx.xxx.com.mmiap.activity" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>


    里面的

    android.intent.category.LAUNCHER  

    改成 

    android.intent.category.DEFAULT 

     就可以。


    问题源头:

     <activity android:name="com.x210.intentfilters.OneActivity"android:label="oneActivity">  

                <intent-filter>

                    <actionandroid:name="myapp.action.test1" />

                    <actionandroid:name="myapp.action.test2" />  

                </intent-filter>

     </activity>

    <Intent-filter>节点中缺少:

    <category android:name="android.intent.category.DEFAULT"/>

    原因:

    因为在通过Intent调用Activity时,Android默认会自己主动加入CATEGORY_DEFAULT类别属性。故在Filter配置中CATEGORY_DEFAULT是必不可少的。


    參考资料:http://blog.csdn.net/andie_guo/article/details/9273755


  • 相关阅读:
    Java学习二十九天
    Java学习二十八天
    47. Permutations II 全排列可重复版本
    46. Permutations 全排列,无重复
    subset ii 子集 有重复元素
    339. Nested List Weight Sum 339.嵌套列表权重总和
    251. Flatten 2D Vector 平铺二维矩阵
    217. Contains Duplicate数组重复元素
    209. Minimum Size Subarray Sum 结果大于等于目标的最小长度数组
    438. Find All Anagrams in a String 查找字符串中的所有Anagrams
  • 原文地址:https://www.cnblogs.com/gcczhongduan/p/5144200.html
Copyright © 2020-2023  润新知