shareSDK.xml文件的配置
eg: Appid、AppSecret需要在微信开发者平台进行申请
BypassApproval要设置为false
要设置分享的平台以及分享的内容
Platform.ShareParams sp = new Platform.ShareParams();
sp.setShareType(Platform.SHARE_WEBPAGE);
sp.setText("传展昭");
sp.setUrl(json);
Platform plat = ShareSDK.getPlatform(Wechat.NAME);
plat.setPlatformActionListener(platformActionListener);//授权回调监听,监听oncomplete,onerror,oncancel三种状态
plat.share(sp);
setShareType必须要进行设置成你想分享的类型
android8.0 WXEntryActivity在AndroidManifest.xml文件里面的配置
<activity
android:name=".wxapi.WXEntryActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true" />
方向属性一定去掉android:screenOrientation="portrait"