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