title: login button not responding or displaying anything
body: <p>I'm currently making an app for my thesis project and I used YouTube to watch several tutorials. Now, I followed a lot of videos and did what the narrator said, but when I run my project, my login button is not responding for some reason that I don't know. I added a picture of the event log. I hope it will help you guys to understand.</p>
  
  <p>Here is my <strong>loginRequest.java</strong>:</p>
  
  <pre><code>package com.example.user.login_02;
  
  import com.android.volley.Response;
  import com.android.volley.toolbox.StringRequest;
  
  import java.util.HashMap;
  import java.util.Map;
  
  public class LoginReq extends StringRequest{
  
      private static final String LOGIN_REQ_URL = "http://10.0.2.2/login.php";
      private Map&lt;String, String&gt; params;
  
      public LoginReq(String pincode, Response.Listener&lt;String&gt; listener) {
          super(Method.POST, LOGIN_REQ_URL, listener, null);
          params = new HashMap&lt;&gt;();
          params.put("pincode", pincode);
      }
  
      @Override
      public Map&lt;String, String&gt; getParams() {
          return params;
      }
  
  }
  </code></pre>
  
  <p>my mainActivity.java:</p>
  
  <pre><code>package com.example.user.login_02;
  
  
  import android.content.Intent;
  import android.support.v7.app.AlertDialog;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.toolbox.Volley;
  
  import org.json.JSONException;
  import org.json.JSONObject;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          final EditText etUsername = (EditText) findViewById(R.id.etUsername);
          final EditText etPincode = (EditText) findViewById(R.id.etPincode);
          final Button bLogin = (Button) findViewById(R.id.bLogin);
  
  
          bLogin.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  final String pincode = etPincode.getText().toString();
                  final String username = etUsername.getText().toString();
                  //final int id = etId.getInt().toString();
  
                  Response.Listener&lt;String&gt; responseListener = new Response.Listener&lt;String&gt;() {
                      @Override
                      public void onResponse(String response) {
                          try {
                              JSONObject jsonObject = new JSONObject(response);
                              boolean success = jsonObject.getBoolean("success");
  
                              if (success) {
                                  //String id = jsonObject.getString("id");
  
                                  Intent intent = new Intent(MainActivity.this, UserActivity.class);
                                  intent.putExtra("username", username);
  
                                  MainActivity.this.startActivity(intent);
                              } else {
                                  AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
                                  builder.setMessage("Login Failed")
                                          .setNegativeButton("Retry", null)
                                          .create()
                                          .show();
                              }
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
  
                      }
                  };
  
                  LoginReq loginReq = new LoginReq(pincode, responseListener);
                  RequestQueue queue = Volley.newRequestQueue(MainActivity.this);
                  queue.add(loginReq);
              }
          });
      }
  }
  </code></pre>
  
  <p>my userActivity.java:</p>
  
  <pre><code>package com.example.user.login_02;
  
  import android.content.Intent;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.widget.EditText;
  import android.widget.TextView;
  
  public class UserActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_user);
  
          final EditText etUsername = (EditText) findViewById(R.id.etUsername);
  
          Intent intent = getIntent();
          String username = intent.getStringExtra("username");
  
          etUsername.setText(username);
      }
  }
  </code></pre>
  
  <p>my xml for loginActivity:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.user.login_02.MainActivity"&gt;
  
      &lt;Button
          android:id="@+id/bLogin"
          android:layout_width="177dp"
          android:layout_height="47dp"
          android:layout_marginTop="58dp"
          android:text="LOGIN"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/etPincode"
          app:layout_constraintVertical_bias="0.13"
          tools:layout_editor_absoluteX="59dp"
          android:layout_below="@+id/etPincode"
          android:layout_centerHorizontal="true" /&gt;
  
      &lt;EditText
          android:id="@+id/etUsername"
          android:layout_width="310dp"
          android:layout_height="42dp"
          android:ems="10"
          android:hint="User Name"
          android:inputType="textPersonName"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintLeft_toLeftOf="parent"
          app:layout_constraintRight_toRightOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:layout_constraintVertical_bias="0.039"
          android:layout_alignParentTop="true"
          android:layout_centerHorizontal="true"
          android:layout_marginTop="27dp" /&gt;
  
      &lt;EditText
          android:id="@+id/etPincode"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignEnd="@+id/etUsername"
          android:layout_alignLeft="@+id/etUsername"
          android:layout_alignRight="@+id/etUsername"
          android:layout_alignStart="@+id/etUsername"
          android:layout_below="@+id/etUsername"
          android:layout_marginTop="28dp"
          android:ems="10"
          android:hint="Pincode"
          android:inputType="textPassword" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uGUzX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uGUzX.png" alt="enter image description here"></a></p>