Share Private Umsocialservice Mcontroller; Mcontroller = Umservicefactory.getumsocialservice ("Com.umeng.login"); Set up Sina SSO handler Mcontroller.getconfig (). Setssohandler (New Sinassohandler ()); Parameter 1 is the current activity, parameter 2 for the developer in the QQ Internet application app ID, Parameter 3 for the developer in the QQ Internet application app KEY. Umqqssohandler Qqssohandler = new Umqqssohandler (This, "100424468", "C7394704798a158208a74ab60104f0ba"); QQSSOHANDLER.ADDTOSOCIALSDK (); Parameter 1 is the current activity, parameter 2 for the developer in the QQ Internet application app ID, Parameter 3 for the developer in the QQ Internet application app KEY. Qzonessohandler Qzonessohandler = new Qzonessohandler (This, "100424468", "C7394704798a158208a74ab60104f0ba"); QZONESSOHANDLER.ADDTOSOCIALSDK (); Mcontroller.openshare (Infoactivity.this, false);
Intent Intent = Getintent (); String des = Intent.getstringextra ("des"); LOG.I ("url", des); WebView Web = (WebView) Findviewbyid (R.id.webview); Web.loadurl (DES); Web.setwebviewclient (New Webviewclient () { @Override public boolean shouldoverrideurlloading (WebView view, String URL) { TODO auto-generated Method Stub Return super.shouldoverrideurlloading (view, URL); } }); Button share = (Button) Findviewbyid (R.id.share); Button QQ = (button) Findviewbyid (R.ID.QQ); Button Xinlang = (button) Findviewbyid (R.id.xinlang); Button Qqkong = (button) Findviewbyid (R.id.qqkong); Share.setonclicklistener (this); Qq.setonclicklistener (this); Xinlang.setonclicklistener (this); Qqkong.setonclicklistener (this); Switch (V.getid ()) { Case R.id.share: LinearLayout ll = (linearlayout) Findviewbyid (R.ID.LL); Ll.setvisibility (view.visible); Break Case R.ID.QQ: Sharedata (Share_media. QQ); Break Case R.id.xinlang: Sharedata (Share_media. SINA); Break Case R.id.qqkong: Sharedata (Share_media. QZONE); Break Default Break } private void Sharedata (Share_media platform) {
Mcontroller.dooauthverify (Infoactivity.this, Platform, New Umauthlistener () { @Override public void OnStart (Share_media platform) { Toast.maketext (Infoactivity.this, "Licensing start", Toast.length_short). Show (); } @Override public void OnError (Socializeexception e, Share_media platform) { Toast.maketext (infoactivity.this, "Authorization Error", Toast.length_short). Show (); } @Override public void OnComplete (Bundle value, Share_media platform) { Toast.maketext (Infoactivity.this, "authorized completion", Toast.length_short). Show (); Get relevant licensing information Mcontroller.getplatforminfo (Infoactivity.this, Platform, New Umdatalistener () { @Override public void OnStart () { Toast.maketext (Infoactivity.this, "Get Platform data start ...", Toast.length_short). Show (); } @Override public void OnComplete (int status, map<string, object> info) { if (status = = && info! = null) { StringBuilder sb = new StringBuilder (); set<string> keys = Info.keyset (); for (String Key:keys) { Sb.append (key+ "=" +info.get (key). ToString () + "\ r \ n"); } LOG.D ("TestData", sb.tostring ()); }else{ LOG.D ("TestData", "Error occurred:" +status); } } }); } @Override public void OnCancel (Share_media platform) { Toast.maketext (Infoactivity.this, "authorization cancellation", Toast.length_short). Show (); } } ); Setting up shared content Mcontroller.setsharecontent ("Friends League social Component (SDK) enables mobile apps to quickly integrate social sharing features, http://www.umeng.com/social"); Set up Share pictures Mcontroller.setsharemedia (New Umimage (Infoactivity.this, "http://www.umeng.com/images/pic/banner_module_social.png")); Share directly Mcontroller.directshare (Infoactivity.this, platform, New Snspostlistener () { @Override public void OnStart () { Toast.maketext (Infoactivity.this, "Share Start", Toast.length_short). Show (); } @Override public void OnComplete (Share_media platform,int ecode, socializeentity entity) { if (Ecode = = statuscode.st_code_successed) { Toast.maketext (Infoactivity.this, "sharing success", Toast.length_short). Show (); }else{ Toast.maketext (Infoactivity.this, "Sharing failed", Toast.length_short). Show (); } }
}); } |
|