分享sdk的使用步骤( 二 )


MobSDK.init(context, "你的appkey", "你的appsecrect");

6引入activity:
        <activity
            android:name="com.mob.tools.MobUIShell"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:windowSoftInputMode="stateHidden|adjustResize" >
            <!-- 调用新浪原生SDK , 需要注册的回调activity -->
            <intent-filter>
                <action android:name="com.sina.weibo.sdk.action.ACTION_SDK_REQ_ACTIVITY" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
       
        <activity
            android:name="com.eshore.transporttruck.wxapi.WXEntryActivity"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:exported="true"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
       
       
        <activity
            android:name="cn.sharesdk.tencent.qq.ReceiveActivity"
            android:launchMode="singleTask"
            android:noHistory="true" >
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="tencentXXXX" />XXXX换成qq的appid
            </intent-filter>
        </activity>

7SDK初始化:
MobSDK.init(mActivity);
分享函数:
private void showShare() {
 
OnekeyShare oks = new OnekeyShare();
// 关闭sso授权
oks.disableSSOWhenAuthorize();
// 分享时Notification的图标和文字 2.5.9以后的版本不调用此方法

猜你喜欢