Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void userLogin() {
- username = usernameField.getText().toString().trim();
- password = passwordField.getText().toString().trim();
- RequestQueue queue = Volley.newRequestQueue(this);
- // Request a string response from the provided URL.
- StringRequest stringRequest = new StringRequest(Request.Method.GET, LOGIN_URL,
- new Response.Listener<String>() {
- @Override
- public void onResponse(String response) {
- Toast toast = Toast.makeText(getApplicationContext(), (response), Toast.LENGTH_SHORT);
- toast.show();
- }
- }, new Response.ErrorListener() {
- @Override
- public void onErrorResponse(VolleyError error) {
- Toast toast = Toast.makeText(getApplicationContext(), "Anything doesn't work!", Toast.LENGTH_SHORT);
- toast.show();
- }
- });
- // Add the request to the RequestQueue.
- queue.add(stringRequest);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement