友盟分享初始化逻辑变更,初始化分为预先初始化和正式初始化,升级到4.11.0版本
This commit is contained in:
parent
0eb3527132
commit
0d1f9ef6d7
|
|
@ -229,7 +229,7 @@
|
|||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/apk_path" />
|
||||
android:resource="@xml/filepaths" />
|
||||
</provider>
|
||||
|
||||
<receiver
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import com.umeng.socialize.UMShareAPI;
|
|||
import com.umeng.socialize.UMShareListener;
|
||||
import com.umeng.socialize.bean.SHARE_MEDIA;
|
||||
import com.umeng.socialize.media.UMImage;
|
||||
import com.umeng.socialize.media.UMWeb;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
|
|
@ -209,11 +210,13 @@ public class ImageSeeActivity extends BaseActivity {
|
|||
}
|
||||
};
|
||||
private void share() {//微信 朋友圈 QQ 新浪
|
||||
UMWeb web =new UMWeb(HttpManager.LOOK_HTML_URL+data);
|
||||
web.setTitle(Text.AppName);//标题
|
||||
new ShareAction(ImageSeeActivity.this).setDisplayList(SHARE_MEDIA.WEIXIN,SHARE_MEDIA.WEIXIN_CIRCLE,SHARE_MEDIA.QQ,SHARE_MEDIA.SINA)
|
||||
.withText(Text.AppName)//标题
|
||||
.withText(Text.ShareText)//文字
|
||||
.withMedia(new UMImage(ImageSeeActivity.this,BitmapFactory.decodeFile(files[mViewPager.getCurrentItem()].getAbsolutePath())))//把本地图片当作分享的img上传至友盟
|
||||
.withText(HttpManager.LOOK_HTML_URL+data)//附带的html网址
|
||||
.withMedia(web)//附带的html网址
|
||||
.setCallback(umShareListener)//回调
|
||||
.open();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.umeng.socialize.UMShareAPI;
|
|||
import com.umeng.socialize.UMShareListener;
|
||||
import com.umeng.socialize.bean.SHARE_MEDIA;
|
||||
import com.umeng.socialize.media.UMImage;
|
||||
import com.umeng.socialize.media.UMWeb;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -120,11 +121,13 @@ public class LookAtReportShareActivity extends BaseActivity {
|
|||
}
|
||||
}
|
||||
private void share() {//微信 朋友圈 QQ 新浪
|
||||
UMWeb web =new UMWeb(lookReport.htmlName);
|
||||
web.setTitle(Text.AppName);//标题
|
||||
new ShareAction(LookAtReportShareActivity.this).setDisplayList(SHARE_MEDIA.WEIXIN,SHARE_MEDIA.WEIXIN_CIRCLE,SHARE_MEDIA.QQ,SHARE_MEDIA.SINA)
|
||||
.withText(Text.ShareReportTitle)//标题
|
||||
.withText(lookReport.suggestion)//文字
|
||||
.withMedia(new UMImage(LookAtReportShareActivity.this,HttpManager.LOOK_IMG_URL+lookReport.shareImg))//图片网址
|
||||
.withText(lookReport.htmlName)//附带的html网址
|
||||
.withMedia(web)//附带的html网址
|
||||
.setCallback(umShareListener)//回调
|
||||
.open();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ import com.ifish.utils.UnreadCount;
|
|||
import com.ifish.view.DisplayUtil;
|
||||
import com.lidroid.xutils.http.HttpHandler;
|
||||
import com.p2p.core.P2PHandler;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.umeng.socialize.UMShareAPI;
|
||||
|
||||
import java.net.Socket;
|
||||
|
|
@ -120,6 +121,9 @@ public class MainTabActivity extends BaseFragmentActivity {
|
|||
initView();
|
||||
init();
|
||||
StartWifiChangeTimer();
|
||||
|
||||
//todo 友盟分享SDK初始化
|
||||
UMConfigure.init(this,"5a12384aa40fa3551f0001d1","umeng",UMConfigure.DEVICE_TYPE_PHONE,"");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ public class BaseApplication extends MultiDexApplication {
|
|||
|
||||
//初始化友盟社会化分享
|
||||
private void initShareSDK() {
|
||||
//todo
|
||||
//初始化
|
||||
UMConfigure.preInit(this,"","");
|
||||
/**
|
||||
* 在微博开放平台设置的授权回调REDIRECT_URL必须与代码中设置一致 http://open.weibo.com/apps/1240247140/info/advanced
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ import com.lidroid.xutils.HttpUtils;
|
|||
import com.lidroid.xutils.exception.HttpException;
|
||||
import com.lidroid.xutils.http.ResponseInfo;
|
||||
import com.lidroid.xutils.http.callback.RequestCallBack;
|
||||
import com.lidroid.xutils.util.LogUtils;
|
||||
import com.p2p.core.P2PHandler;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import com.umeng.socialize.ShareAction;
|
||||
|
|
@ -447,21 +448,24 @@ public class MineFragment extends BaseV4Fragment {
|
|||
private UMShareListener umShareListener = new UMShareListener() {
|
||||
@Override
|
||||
public void onStart(SHARE_MEDIA shareMedia) {
|
||||
|
||||
LogUtils.d("ifish LHD 分享回调 onStart");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResult(SHARE_MEDIA platform) {
|
||||
LogUtils.d("ifish LHD 分享回调 onResult "+platform);
|
||||
ToastUtil.show(getActivity(), Text.SHARESUCCESS);
|
||||
goldValue(Commons.GoldTasksKey.SHAREIFISHAPP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(SHARE_MEDIA platform, Throwable t) {
|
||||
LogUtils.e("ifish LHD 分享回调 onError "+platform);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(SHARE_MEDIA platform) {
|
||||
LogUtils.e("ifish LHD 分享回调 onCancel "+platform);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@
|
|||
android:background="@drawable/minefragment_bg_select"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_iv"
|
||||
android:id="@+id/iv_iv1"
|
||||
android:layout_width="@dimen/ic_mine_size"
|
||||
android:layout_height="@dimen/ic_mine_size"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
android:src="@drawable/ic_mine_qrcode"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_toRightOf="@+id/iv_iv"
|
||||
android:layout_toRightOf="@+id/iv_iv1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -222,7 +222,7 @@
|
|||
android:background="@drawable/minefragment_bg_select"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_iv"
|
||||
android:id="@+id/iv_iv2"
|
||||
android:layout_width="@dimen/ic_mine_size"
|
||||
android:layout_height="@dimen/ic_mine_size"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -231,7 +231,7 @@
|
|||
android:src="@drawable/ic_mine_lookat"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_toRightOf="@+id/iv_iv"
|
||||
android:layout_toRightOf="@+id/iv_iv2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -256,7 +256,7 @@
|
|||
android:background="@drawable/minefragment_bg_select"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_iv"
|
||||
android:id="@+id/iv_iv3"
|
||||
android:layout_width="@dimen/ic_mine_size"
|
||||
android:layout_height="@dimen/ic_mine_size"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
android:src="@drawable/ic_mine_aboutus"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_toRightOf="@+id/iv_iv"
|
||||
android:layout_toRightOf="@+id/iv_iv3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -295,7 +295,7 @@
|
|||
android:background="@drawable/minefragment_bg_select"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_iv"
|
||||
android:id="@+id/iv_iv4"
|
||||
android:layout_width="@dimen/ic_mine_size"
|
||||
android:layout_height="@dimen/ic_mine_size"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -304,7 +304,7 @@
|
|||
android:src="@drawable/ic_mine_setting"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_toRightOf="@+id/iv_iv"
|
||||
android:layout_toRightOf="@+id/iv_iv4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -330,7 +330,7 @@
|
|||
android:background="@drawable/minefragment_bg_select"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_iv"
|
||||
android:id="@+id/iv_iv5"
|
||||
android:layout_width="@dimen/ic_mine_size"
|
||||
android:layout_height="@dimen/ic_mine_size"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -339,7 +339,7 @@
|
|||
android:src="@drawable/ic_mine_shareapp"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_toRightOf="@+id/iv_iv"
|
||||
android:layout_toRightOf="@+id/iv_iv5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -370,7 +370,7 @@
|
|||
android:background="@drawable/minefragment_bg_select"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_iv"
|
||||
android:id="@+id/iv_iv6"
|
||||
android:layout_width="@dimen/ic_mine_size"
|
||||
android:layout_height="@dimen/ic_mine_size"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -379,7 +379,7 @@
|
|||
android:src="@drawable/ic_mine_explain"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_toRightOf="@+id/iv_iv"
|
||||
android:layout_toRightOf="@+id/iv_iv6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -411,7 +411,7 @@
|
|||
android:layout_marginBottom="@dimen/mine_fragment_gray_size"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/iv_iv"
|
||||
android:id="@+id/iv_iv7"
|
||||
android:layout_width="@dimen/ic_mine_size"
|
||||
android:layout_height="@dimen/ic_mine_size"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
@ -420,7 +420,7 @@
|
|||
android:src="@drawable/ic_mine_tellus"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_toRightOf="@+id/iv_iv"
|
||||
android:layout_toRightOf="@+id/iv_iv7"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
|
|||
Loading…
Reference in New Issue