public void login(View v) {
   String userName = username.getText().toString();
   String passWord = password.getText().toString();
   if (userName.length() == 0 || passWord.length() == 0) {
     Toast.makeText(
             this, this.getResources().getString(R.string.login_error_input), Toast.LENGTH_SHORT)
         .show();
   } else {
     // if(Utils.checkEmail(userName)) {
     progressBar.setVisibility(View.VISIBLE);
     analyzer.setContent(userName, passWord);
     new Thread() {
       public void run() {
         ResponseMessage msg = analyzer.connect();
         String suc = analyzer.analyseJson(msg.message, msg.code);
         Message message = loginHandler.obtainMessage();
         if (suc.equals("success")) {
           message.what = 0;
         } else {
           message.what = -1;
           message.obj = suc;
         }
         loginHandler.sendMessage(message);
       }
     }.start();
     /*}else {
     	Toast.makeText(this, this.getResources().getString(R.string.login_error_email), Toast.LENGTH_SHORT).show();
     }*/
   }
 }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_login);
   progressBar = (RelativeLayout) findViewById(R.id.login_loading_layout);
   username = (ClearEditText) findViewById(R.id.login_user);
   password = (ClearEditText) findViewById(R.id.login_password);
   Bundle b = getIntent().getExtras();
   if (b != null && b.getString("username") != null && b.getString("username").length() > 0) {
     username.setText(b.getString("username"));
   }
   analyzer = new LoginAnalyzer(this);
 }