Commit bac4f8e438b154f7347c6da6ff8462e8f7d92707

Authored by 袁思汶
1 parent 03b7c912

未登录分享图片

OutSide_Share/src/main/java/com/cnlive/outside_share/activity/ShareMomentActivity.java
... ... @@ -105,8 +105,6 @@ public class ShareMomentActivity extends AppCompatActivity {
105 105 public void checkIntent() {
106 106 equals = "shareMom".equals(outTyp); ////是否二次登陆 以下所有type均需要判断是否二次登录
107 107 preferences = this.getSharedPreferences("OutShare", MODE_PRIVATE); //IM重连前存储信息
108   -
109   - if (bundle != null && action != null) {
110 108 switch (action) {
111 109 case Intent.ACTION_SEND:
112 110 jumpToSend(this, type, bundle);
... ... @@ -118,7 +116,6 @@ public class ShareMomentActivity extends AppCompatActivity {
118 116 AlertUtil.showDeftToast(this, "网家家暂不支持此类型信息分享.");
119 117 break;
120 118 }
121   - }
122 119 }
123 120  
124 121 @RequiresApi(api = Build.VERSION_CODES.KITKAT) //单发
... ... @@ -140,7 +137,7 @@ public class ShareMomentActivity extends AppCompatActivity {
140 137 }
141 138 }.start();
142 139 }
143   - if (bundle == null || type == null) {
  140 + if (type == null) {
144 141 AlertUtil.showDeftToast(this, "数据获取异常,暂不支持此机型分享.");
145 142 killTime();
146 143 } else if (type.startsWith("text/")) {
... ... @@ -325,7 +322,7 @@ public class ShareMomentActivity extends AppCompatActivity {
325 322 }
326 323 } else if (type.startsWith("image/")) {
327 324 //兼容QQ浏览器链接类型
328   - if (bundle.get(TEXT) != null && bundle.getParcelable(Intent.EXTRA_STREAM) == null) {
  325 + if (bundle!=null && bundle.get(TEXT) != null && bundle.getParcelable(Intent.EXTRA_STREAM) == null) {
329 326 String bundleText = bundle.get(TEXT) + "";
330 327 if (bundleText.contains("@QQ浏览器") || bundleText.contains("html5.qq.com") || bundleText.contains("mbrowser.baidu.com")) {
331 328 String qqLink = bundleText.substring(bundleText.indexOf("http"));
... ... @@ -340,7 +337,7 @@ public class ShareMomentActivity extends AppCompatActivity {
340 337 shareConfig.shareRelease(context);
341 338 finish();
342 339 }
343   - } else if (bundle.get(TEXT) == null && bundle.get("weixin_text") != null && (bundle.get("weixin_text") + "").contains("liebao.cn")) { //兼容舔狗猎豹浏览器内置图片分享问题
  340 + } else if (bundle!=null && bundle.get(TEXT) == null && bundle.get("weixin_text") != null && (bundle.get("weixin_text") + "").contains("liebao.cn")) { //兼容舔狗猎豹浏览器内置图片分享问题
344 341 String weixin_text = (bundle.get("weixin_text") + "").substring((bundle.get("weixin_text") + "").indexOf("http"));
345 342 String weixin_title = bundle.get("weixin_title") + "";
346 343 String weixin_img_url = bundle.get("weixin_img_url") + "";
... ...
app/src/main/java/com/cnlive/out_shared/momentActivity.java
... ... @@ -2,7 +2,9 @@ package com.cnlive.out_shared;
2 2  
3 3 import androidx.appcompat.app.AppCompatActivity;
4 4  
  5 +import android.content.ClipData;
5 6 import android.content.Intent;
  7 +import android.net.Uri;
6 8 import android.os.Bundle;
7 9  
8 10 import com.alibaba.android.arouter.launcher.ARouter;
... ... @@ -24,11 +26,19 @@ public class momentActivity extends AppCompatActivity {
24 26 type = intent.getType();
25 27 extras = intent.getExtras();
26 28 action = intent.getAction();
  29 + ClipData clipData = intent.getClipData();
  30 + final ArrayList<String> strings = new ArrayList<>();
  31 + if (clipData != null)
  32 + for (int i = 0; i < clipData.getItemCount(); i++) {
  33 + ClipData.Item itemAt = clipData.getItemAt(i);
  34 + Uri uri = itemAt.getUri();
  35 + strings.add(uri.toString());
  36 + }
27 37 ARouter.getInstance().build("/out/ShareMomentActivity")
28 38 .withString("type", type)
29 39 .withString("action", action)
30 40 .withBundle("bundle", extras)
31   - .withStringArrayList("mutil",new ArrayList<>())
  41 + .withStringArrayList("mutil",strings)
32 42 .navigation(this);
33 43 }
34 44 }
35 45 \ No newline at end of file
... ...
config.gradle
... ... @@ -21,7 +21,7 @@ ext {
21 21 //编译方式
22 22 debug : false,
23 23 //版本号
24   - version: "1.0.0.8",
  24 + version: "1.0.0.9",
25 25 //Lib库前缀
26 26 packeg : "com.cnlive.outside_share",
27 27 //Lib库名称
... ...