zoukankan      html  css  js  c++  java
  • 第三方登录

      

    [代码]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=""> 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,>
  • 相关阅读:
    CF351A Jeff and Rounding 思维
    CF352B Jeff and Periods 模拟
    CF352A Jeff and Digits
    小B的询问 莫队分块
    小凯的疑惑 数学
    BestCoder Round #80 待填坑
    [SDOI2009]HH的项链 树状数组 BZOJ 1878
    Blocks poj 区间dp
    [USACO5.4]奶牛的电信Telecowmunication 最小割
    数位dp
  • 原文地址:https://www.cnblogs.com/android-blogs/p/5623983.html
Copyright © 2011-2022 走看看