@Override public void onError(String error) { SPManager.delete(SPManager.KEY_GCM_REG_ID); eLog("Error in GCM Registration " + error); }
@Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_login: edit_email_phone.setError(null); editPassword.setError(null); passsword = editPassword.getText().toString(); if (validate()) { if (passsword.length() > 0) { if (checkBox.isChecked()) { SPManager.saveBoolean(SPManager.KEY_IS_CHECKED, checkBox.isChecked()); SPManager.save(SPManager.KEY_USERNAME, emailMobile); SPManager.save(SPManager.KEY_PASSWORD, passsword); } else { SPManager.delete(SPManager.KEY_IS_CHECKED); } if (isDeviceConnected()) { if (SPManager.retrive(SPManager.KEY_GCM_REG_ID) != null) { if (gcmId != null) { callLoginWebservice(emailMobile, passsword); } else { smallToast("Gcm Registration Error try again latter !!!"); registerForGcm(); } } else { } } else { smallToast(getString(R.string.errorNoInternet)); } } else { editPassword.setError("Invalid Password"); editPassword.requestFocus(); } } break; case R.id.btnRegister: Intent intent = new Intent(LoginActivity.this, RegisterActivity.class); startActivity(intent); break; case R.id.txtForgetPwd: DialogFragment dialogFragment = new DialogFragment(false, this); dialogFragment.show(getSupportFragmentManager(), "ResetPassword"); break; default: break; } }