Beispiel #1
0
  @Override
  protected void onResume() {
    super.onResume();

    NFacade.get()
        .login(
            new HttpCallBack() {
              @Override
              public void execute(ResultResponse response) {

                String name = response.getData();
              }
            });
  }
Beispiel #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);
    initData();

    show_password.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            if (isChecked) {
              // 显示密码
              input_password.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
              show_password.setText("隐藏密码");
            } else {
              // 隐藏密码
              input_password.setTransformationMethod(PasswordTransformationMethod.getInstance());
              show_password.setText("显示密码");
            }
            if (isChecked = !isChecked) {
              input_password.setTransformationMethod(PasswordTransformationMethod.getInstance());
            }
          }
        });

    login_btn.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            login();
          }
        });

    login_problem.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {}
        });

    free_register.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            gotoActivity(new Intent(Login.this, Register.class));
          }
        });
  }