Android shares all operations to the QQ space, androidqq

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.