Commit 240329228b179b7c6224a78ae16e109ee76166e6
1 parent
89760718
升级
Showing
2 changed files
with
9 additions
and
2 deletions
OutSide_Share/src/main/java/com/cnlive/outside_share/activity/ShareMomentActivity.java
| @@ -355,7 +355,14 @@ public class ShareMomentActivity extends AppCompatActivity { | @@ -355,7 +355,14 @@ public class ShareMomentActivity extends AppCompatActivity { | ||
| 355 | killTime(); | 355 | killTime(); |
| 356 | } else { | 356 | } else { |
| 357 | sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, imageUri)); | 357 | sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, imageUri)); |
| 358 | - String pathreal = getPath(context, imageUri); | 358 | + if (imageUri.toString().contains("/") && imageUri.toString().contains(".")) { |
| 359 | + String fileName = imageUri.toString().substring(imageUri.toString().lastIndexOf("/"), imageUri.toString().lastIndexOf(".")); | ||
| 360 | + String fileType = imageUri.toString().substring(imageUri.toString().lastIndexOf("."), imageUri.toString().length()); | ||
| 361 | + pathreal = AndroidQUtil.copyAndroidQFile(this, imageUri.toString(), StringUtils.decode(fileName) + fileType); | ||
| 362 | + }else { | ||
| 363 | + pathreal = AndroidQUtil.copyAndroidQFile(this, imageUri.toString(), System.currentTimeMillis() + ".png"); | ||
| 364 | + } | ||
| 365 | + //String pathreal = getPath(context, imageUri); | ||
| 359 | String fileType = FileType.getFileType(pathreal); | 366 | String fileType = FileType.getFileType(pathreal); |
| 360 | if ("wbmp".equals(fileType) || pathreal == null || pathreal.endsWith("gif")) { | 367 | if ("wbmp".equals(fileType) || pathreal == null || pathreal.endsWith("gif")) { |
| 361 | AlertUtil.showDeftToast(context, "网家家暂不支持此格式图片分享."); | 368 | AlertUtil.showDeftToast(context, "网家家暂不支持此格式图片分享."); |
config.gradle