ShareUtil icon indicating copy to clipboard operation
ShareUtil copied to clipboard

在MI 3C手机上系统默认的分享会失败,提示 应用未安装

Open totzcc opened this issue 8 years ago • 0 comments

04-06 14:11:08.850 4452-4452/my.com.bit.jpjjr.android E/gold: 分享失败
                                                              java.lang.Exception: The application is not install
                                                                  at me.shaohui.shareutil.ShareUtil.action(ShareUtil.java:70)
                                                                  at me.shaohui.shareutil._ShareActivity.onCreate(_ShareActivity.java:43)
                                                                  at android.app.Activity.performCreate(Activity.java:6251)
                                                                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
                                                                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
                                                                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
                                                                  at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
                                                                  at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                  at android.os.Looper.loop(Looper.java:148)
                                                                  at android.app.ActivityThread.main(ActivityThread.java:5461)
                                                                  at java.lang.reflect.Method.invoke(Native Method)
                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

修改如下代码暂时解决

DefaultShareInstance.java

    @Override
    public boolean isInstall(Context context) {
//        Intent shareIntent = new Intent();
//        shareIntent.setAction(Intent.ACTION_SEND);
//        return context.getPackageManager()
//                .resolveActivity(shareIntent, PackageManager.MATCH_DEFAULT_ONLY) != null;
        return true;
    }

totzcc avatar Apr 06 '17 06:04 totzcc