Skip to content

Commit

Permalink
修复了分享图片到qq的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
郭文明 committed Sep 14, 2016
1 parent 407f930 commit 4223c01
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion multiwindow/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 24
compileSdkVersion 23
buildToolsVersion "24.0.1"

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion weiSwift/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
compileSdkVersion 23
buildToolsVersion '23.0.3'

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.view.Window;
import android.widget.LinearLayout;
Expand All @@ -17,7 +16,6 @@
import com.wenming.weiswift.mvp.presenter.WeiBoArrowPresent2;
import com.wenming.weiswift.mvp.presenter.imp.WeiBoArrowPresenterImp2;
import com.wenming.weiswift.ui.login.fragment.home.weiboitem.WeiboAdapter;
import com.wenming.weiswift.utils.SaveImgUtil;
import com.wenming.weiswift.utils.ToastUtil;

import java.io.File;
Expand Down Expand Up @@ -164,7 +162,7 @@ private void showShare(String imgPath) {

private File bitmap2File(Bitmap bitmap) {
String filename = new SimpleDateFormat("yyyyMMddHHmmss").format(System.currentTimeMillis()) + ".jpg";
String dir = SaveImgUtil.IMGDIR;
String dir = Environment.getExternalStorageDirectory().getPath() + "/weiSwift/.cache/";
File dirFile = new File(dir);
if (!dirFile.exists()) {
dirFile.mkdirs();
Expand All @@ -186,12 +184,7 @@ private File bitmap2File(Bitmap bitmap) {
} catch (Exception e) {
e.printStackTrace();
}
//通知更新
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
Uri uri = Uri.fromFile(bitmapFile);
intent.setData(uri);
mContext.sendBroadcast(intent);
Toast.makeText(mContext, "保存成功!", Toast.LENGTH_SHORT).show();
Toast.makeText(mContext, "截图成功!", Toast.LENGTH_SHORT).show();
return bitmapFile;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void showShare(String imgPath) {
//关闭sso授权
oks.disableSSOWhenAuthorize();
// title标题,印象笔记、邮箱、信息、微信、人人网和QQ空间使用
oks.setTitle(mContext.getString(R.string.share_title));
//oks.setTitle(mContext.getString(R.string.share_title));
// text是分享文本,所有平台都需要这个字段
//oks.setText("来自WeiSwift微博客户端");
//imagePath是图片的本地路径,Linked-In以外的平台都支持此参数
Expand Down

0 comments on commit 4223c01

Please sign in to comment.