Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HashMap<String, String> map = new HashMap<>();
- map.put("key Name", getEditTextValue(define id));
- appDialogs.showProgressDialog();
- callAPiActivity.doPost((Activity) mContext, map, Constant.URL, new GetApiResultJson() {
- @Override
- public void onSuccesResult(JSONObject result) throws JSONException {
- appDialogs.hideProgressDialog();
- JSONObject data = result.getJSONObject("details");
- User user = new User();
- user.setUser_id(data.getString("Key name"));
- prefrences.setUserData(user);
- appDialogs.setSuccessToast(result.optString("message"));
- Intent intent = new Intent(mContext, HomeWithViewPagerActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(intent);
- }
- @Override
- public void onFailureResult(String messgae) throws JSONException {
- appDialogs.hideProgressDialog();
- appDialogs.setErrorToast(messgae);
- }
- @Override
- public void onNetworkRetry(String messgae) throws JSONException {
- }
- });
- }
- public boolean isValide() {
- String emailPattern = "^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$";
- if (!edtEmail.getText().toString().matches(emailPattern)) {
- edtEmail.setError("Please enter a valid email address");
- return false;
- } else if (edtPassword.getText().toString().length() < 6) {
- edtPassword.setError("Password must be 6 character long");
- return false;
- }
- return true;
- }
Add Comment
Please, Sign In to add comment