Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static final String PASSWORD = "pwd";
- });
- }
- private void userLogin(){
- final String scode= code.getText().toString();
- final String userId= email.getText().toString();
- final String pwd= password.getText().toString();
- RequestQueue requestQueue = Volley.newRequestQueue(this);
- StringRequest stringRequest = new StringRequest(Request.Method.GET, LOGIN_URL, new Response.Listener<String>() {
- @Override
- public void onResponse(String response) {
- // Log.d(TAG, "Register Response: " + response.toString());
- try {
- JSONObject jsonObject=new JSONObject(response);
- //if(response.trim().equals("Message")){
- // JSONArray jsonArray = jsonObject.getJSONArray("Result");
- // if(jsonObject.equals(null))
- if (null == jsonObject.get("Result"))
- {
- Toast.makeText(MainActivity.this, "Logged In", Toast.LENGTH_SHORT).show();
- //Intent intent = new Intent(getApplicationContext(), Reg.class);
- Toast.makeText(MainActivity.this, error.toString(), Toast.LENGTH_LONG).show();
- }
- }){
- @Override
- public Map<String, String>getParams() throws AuthFailureError {
- Map<String, String> params = new HashMap<String, String>();
- params.put(CODE, scode);
- params.put(EMAIL, userId);
- params.put(PASSWORD, pwd);
- return params;
- }
- };
- requestQueue.add(stringRequest);
- }
Add Comment
Please, Sign In to add comment