Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void checklogin(View view) {
- // Get text from username and passord field
- final String username = id.getText().toString();
- final String password = pwd.getText().toString();
- if (username.length()==0){
- status.setText("Please enter userid");
- }
- else if(password.length()==0){
- status.setText("Please enter password");
- }
- else {
- StringRequest stringRequest = new StringRequest(Request.Method.POST, REGISTER_URL,
- new Response.Listener<String>() {
- @Override
- public void onResponse(String response) {
- status.setText(response+"ss");
- }
- },
- new Response.ErrorListener() {
- @Override
- public void onErrorResponse(VolleyError error) {
- status.setText(error.toString());
- }
- }){
- @Override
- protected Map<String,String> getParams(){
- Map<String,String> params = new HashMap<String, String>();
- params.put("id",username);
- params.put("pwd",password);
- return params;
- }
- };
- RequestQueue requestQueue = Volley.newRequestQueue(MainActivity.this);
- requestQueue.add(stringRequest);
- }
- }
Add Comment
Please, Sign In to add comment