Android shares all operations to the QQ space, androidqq
Http://wiki.open.qq.com/wiki/mobile/sdkdownload
<! -- The following two activities must be added for QZone sharing --> <activity android: name = "com. tencent. connect. common. activity activity "android: configChanges =" orientation | keyboardHidden "android: screenOrientation =" portrait "android: theme =" @ android: style/Theme. translucent. noTitleBar "/> <activity android: name =" com. tencent. tauth. authActivity "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 =" tencent222222 "/> <! -- Appid: 222222 --> <! -- 100380359 100381104 222222 --> </intent-filter> </activity>
Oncreate // QQ mTencent = Tencent. createInstance (Constant. QQKJ_APPID, this );
/**
* QQ space sharing
* @ Param v
*/
Public void tow.qqkj (){
Final Bundle params = new Bundle ();
Params. putInt (QzoneShare. SHARE_TO_QZONE_KEY_TYPE, QzoneShare. SHARE_TO_QZONE_TYPE_IMAGE_TEXT); // type
Params. putString (QzoneShare. pai_to_qq_title, "domineering James"); // Title
Params. putString (QzoneShare. pai_to_qq_summary, "domineering Haha James"); // Summary
Params. putString (QzoneShare. SHARE_TO_QQ_TARGET_URL, "http://www.beehood.com ");
// The following must be added. Otherwise, the QQ space cannot be transferred.
ArrayList <String> imageUrls = new ArrayList <String> ();
ImageUrls. add ("http://www.beehood.com/uploads/allimg/150310/2-150310142133.jpg ");
Params. putStringArrayList (QzoneShare. pai_to_qq_image_url, imageUrls );
DoShareToQzone (params );
}
/**
* Start sharing in asynchronous mode
* @ Param params
*/
Private void doShareToQzone (final Bundle params ){
New Thread (new Runnable (){
@ Override
Public void run (){
// TODO Auto-generated method stub
MTencent. shareToQzone (SettingActivity. this, params, qZoneShareListener );
}
}). Start ();
}
/**
* Share a listener
*/
IUiListener qZoneShareListener = new IUiListener (){
@ Override
Public void onCancel (){
// Toast. makeText (SettingActivity. this, "cancel", 0). show ();
Log. I ("QZone", "cancel sharing ");
}
@ Override
Public void onError (UiError e ){
Log. I ("QZone", "error:" + e. errorMessage );
// TODO Auto-generated method stub
// Toast. makeText (SettingActivity. this, "onError:" + e. errorMessage, 0). show ();
// Util. toastMessage (QZoneShareActivity. this, "onError:" + e. errorMessage, "e ");
}
@ Override
Public void onComplete (Object response ){
Log. I ("QZone", "complete sharing ");
// TODO Auto-generated method stub
// Toast. makeText (SettingActivity. this, "onComplete:" + response. toString (), 0). show ();
// Util. toastMessage (QZoneShareActivity. this, "onComplete:" + response. toString ());
}};
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.