分享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以后的版本不調用此方法

猜你喜歡