Commit bac4f8e438b154f7347c6da6ff8462e8f7d92707
1 parent
03b7c912
未登录分享图片
Showing
3 changed files
with
15 additions
and
8 deletions
OutSide_Share/src/main/java/com/cnlive/outside_share/activity/ShareMomentActivity.java
| @@ -105,8 +105,6 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -105,8 +105,6 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 105 | public void checkIntent() { | 105 | public void checkIntent() { |
| 106 | equals = "shareMom".equals(outTyp); ////是否二次登陆 以下所有type均需要判断是否二次登录 | 106 | equals = "shareMom".equals(outTyp); ////是否二次登陆 以下所有type均需要判断是否二次登录 |
| 107 | preferences = this.getSharedPreferences("OutShare", MODE_PRIVATE); //IM重连前存储信息 | 107 | preferences = this.getSharedPreferences("OutShare", MODE_PRIVATE); //IM重连前存储信息 |
| 108 | - | ||
| 109 | - if (bundle != null && action != null) { | ||
| 110 | switch (action) { | 108 | switch (action) { |
| 111 | case Intent.ACTION_SEND: | 109 | case Intent.ACTION_SEND: |
| 112 | jumpToSend(this, type, bundle); | 110 | jumpToSend(this, type, bundle); |
| @@ -118,7 +116,6 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -118,7 +116,6 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 118 | AlertUtil.showDeftToast(this, "网家家暂不支持此类型信息分享."); | 116 | AlertUtil.showDeftToast(this, "网家家暂不支持此类型信息分享."); |
| 119 | break; | 117 | break; |
| 120 | } | 118 | } |
| 121 | - } | ||
| 122 | } | 119 | } |
| 123 | 120 | ||
| 124 | @RequiresApi(api = Build.VERSION_CODES.KITKAT) //单发 | 121 | @RequiresApi(api = Build.VERSION_CODES.KITKAT) //单发 |
| @@ -140,7 +137,7 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -140,7 +137,7 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 140 | } | 137 | } |
| 141 | }.start(); | 138 | }.start(); |
| 142 | } | 139 | } |
| 143 | - if (bundle == null || type == null) { | 140 | + if (type == null) { |
| 144 | AlertUtil.showDeftToast(this, "数据获取异常,暂不支持此机型分享."); | 141 | AlertUtil.showDeftToast(this, "数据获取异常,暂不支持此机型分享."); |
| 145 | killTime(); | 142 | killTime(); |
| 146 | } else if (type.startsWith("text/")) { | 143 | } else if (type.startsWith("text/")) { |
| @@ -325,7 +322,7 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -325,7 +322,7 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 325 | } | 322 | } |
| 326 | } else if (type.startsWith("image/")) { | 323 | } else if (type.startsWith("image/")) { |
| 327 | //兼容QQ浏览器链接类型 | 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 | String bundleText = bundle.get(TEXT) + ""; | 326 | String bundleText = bundle.get(TEXT) + ""; |
| 330 | if (bundleText.contains("@QQ浏览器") || bundleText.contains("html5.qq.com") || bundleText.contains("mbrowser.baidu.com")) { | 327 | if (bundleText.contains("@QQ浏览器") || bundleText.contains("html5.qq.com") || bundleText.contains("mbrowser.baidu.com")) { |
| 331 | String qqLink = bundleText.substring(bundleText.indexOf("http")); | 328 | String qqLink = bundleText.substring(bundleText.indexOf("http")); |
| @@ -340,7 +337,7 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -340,7 +337,7 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 340 | shareConfig.shareRelease(context); | 337 | shareConfig.shareRelease(context); |
| 341 | finish(); | 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 | String weixin_text = (bundle.get("weixin_text") + "").substring((bundle.get("weixin_text") + "").indexOf("http")); | 341 | String weixin_text = (bundle.get("weixin_text") + "").substring((bundle.get("weixin_text") + "").indexOf("http")); |
| 345 | String weixin_title = bundle.get("weixin_title") + ""; | 342 | String weixin_title = bundle.get("weixin_title") + ""; |
| 346 | String weixin_img_url = bundle.get("weixin_img_url") + ""; | 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,7 +2,9 @@ package com.cnlive.out_shared; | ||
| 2 | 2 | ||
| 3 | import androidx.appcompat.app.AppCompatActivity; | 3 | import androidx.appcompat.app.AppCompatActivity; |
| 4 | 4 | ||
| 5 | +import android.content.ClipData; | ||
| 5 | import android.content.Intent; | 6 | import android.content.Intent; |
| 7 | +import android.net.Uri; | ||
| 6 | import android.os.Bundle; | 8 | import android.os.Bundle; |
| 7 | 9 | ||
| 8 | import com.alibaba.android.arouter.launcher.ARouter; | 10 | import com.alibaba.android.arouter.launcher.ARouter; |
| @@ -24,11 +26,19 @@ public class momentActivity extends AppCompatActivity { | @@ -24,11 +26,19 @@ public class momentActivity extends AppCompatActivity { | ||
| 24 | type = intent.getType(); | 26 | type = intent.getType(); |
| 25 | extras = intent.getExtras(); | 27 | extras = intent.getExtras(); |
| 26 | action = intent.getAction(); | 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 | ARouter.getInstance().build("/out/ShareMomentActivity") | 37 | ARouter.getInstance().build("/out/ShareMomentActivity") |
| 28 | .withString("type", type) | 38 | .withString("type", type) |
| 29 | .withString("action", action) | 39 | .withString("action", action) |
| 30 | .withBundle("bundle", extras) | 40 | .withBundle("bundle", extras) |
| 31 | - .withStringArrayList("mutil",new ArrayList<>()) | 41 | + .withStringArrayList("mutil",strings) |
| 32 | .navigation(this); | 42 | .navigation(this); |
| 33 | } | 43 | } |
| 34 | } | 44 | } |
| 35 | \ No newline at end of file | 45 | \ No newline at end of file |
config.gradle