[代码]java代码:
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | //登录 public void login(View v){ Platform platform11 = ShareSDK.getPlatform(QQ.NAME); //platform11.SSOSetting(true); platform11.authorize(); platform11.showUser(null);//必须要加的要不然不行!这个才是授权的! tm = (TelephonyManager) MainActivity.this.getSystemService(TELEPHONY_SERVICE); imi = tm.getDeviceId(); platform11.setPlatformActionListener(new PlatformActionListener() { @Override public void onError(Platform platform11, int arg1, Throwable arg2) { //弹出失败窗口 } @SuppressLint("SimpleDateFormat") @Override public void onComplete(Platform platform11, int arg1, HashMap<string, object="" deep="7"> arg2) { System.out.println("登录成功。。。。"); Toast.makeText(MainActivity.this, "登录成功。。。。", 0).show();
/*String userId = platform11.getDb().getUserId(); String userName = platform11.getDb().getUserName(); String token = platform11.getDb().getToken(); long expiresTime = platform11.getDb().getExpiresTime(); SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); System.out.println("userId "+userId); System.out.println("userName "+userName); System.out.println("token "+token); System.out.println("expiresTime "+sdf3.format(expiresTime)); HttpUties ht=new HttpUties(); ht.UplodePhotos(1+"", userId+"", userName+"", token+"", expiresTime+"", imi+"");*/ } @Override public void onCancel(Platform arg0, int arg1) {
} }); }</string,> |
共同学习,写下你的评论
评论加载中...
作者其他优质文章