Android Sina Weibo login get Access_token value problem

Source: Internet
Author: User

Test today that small mm said the engineer here Sina Weibo login not on, I was thinking that this is not done well, their own test login is not sure, and then found that Weibo licensing is successful but to get OpenID and Access_token passed to the backstage, found Access_ Token value is null, immediately put the friends of the demo run debug, because the friends of these values are stored in the bundle, debug found QQ login and micro-blog login return value is not the same, the following code line

Mcontroller.dooauthverify (Loginresultactivity.this, Share_media. Sina,new Umauthlistener () {@Override public void OnError (Socializeexception e, Share_media platform            ) {Dissdialog (); } @Override public void OnComplete (Bundle value, Share_media platform) {if (value! = NULL && AMP;!        Textutils.isempty (value.getstring ("UID"))) {String OpenID = value.getstring ("UID");        String Access_token = value.getstring ("Access_key"); if (openid!=null&&! "".        Equals (OpenID)) {map<string,string> params = new hashmap<string, string> ();        Params.put ("Platform", "2");        Params.put ("OpenID", OpenID);        Params.put ("Openkey", Access_token);        Protocolmanager.getinstance (). Request (Protocolenum.url_account_login, params, new Requestlistener () {@Override        public void onrequestsucess (String response) {Constant.login_weibo_tag = 1; if (! Textutils. IsEmpty (response)) {Logininfo Logininfo = Jsonhelper.json2bean (response, Logininfo.class); if (Logininfo!=null&&logininfo.getret () ==0) {/** * player ID is saved in memory */Cons            Tant.id = Logininfo.getid ();            Save player ID to sd card saveutils.getinstance (). savestring ("id", Logininfo.getid ());            Saveutils.getinstance (). Saveint ("Login", 3);            Loginhx (Logininfo.getid ());            }else if (Logininfo!=null&&logininfo.getret () ==1) {showtoast.show ("Login Failed");            Dissdialog (); }}} @Override public void onrequestfiled (String errormsg) {log.e (TAG, "Weibo = =" +errormsg        );        Mhandler.sendemptymessage (Login_fail);        }        });             }}} @Override public void OnCancel (Share_media platform) {            Dissdialog (); } @Override public void OnStart (Share_meDIA platform) {createdialog (); }      });
The key is this line of code string Access_token = value.getstring ("Access_key");Access_token, later found the wrong to find this mistake the fastest is the friend of the demo run to see the bundle in the value of the key to know what to write! In this record

Android Sina Weibo login get Access_token value problem

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.