android studio button not working
<p>I created a android studio button for my app and when I click on the register button it doesn't work . I don't get any errors it just doesn't work . When the user clicks the register button I want to go to the login activity .</p>

<p>RegisterActivity.java :</p>

<pre><code>import android.app.AlertDialog;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
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 RegisterActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_register);

    final EditText etUsername = (EditText) findViewById(R.id.etUsername);
    final EditText etPassword = (EditText) findViewById(R.id.etPassword);
    final Button bRegister = (Button) findViewById(R.id.bRegister);

    bRegister.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            final String username = etUsername.getText().toString();
            final String password = etPassword.getText().toString();

            Response.Listener&lt;String&gt; responseListener = new Response.Listener&lt;String&gt;() {
                @Override
                public void onResponse(String response) {
                    try {
                        JSONObject jsonResponse = new JSONObject(response);
                        boolean success = jsonResponse.getBoolean("success");
                        if (success) {
                            Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
                            RegisterActivity.this.startActivity(intent);
                        } else {
                            AlertDialog.Builder builder = new AlertDialog.Builder(RegisterActivity.this);
                            builder.setMessage("Register Failed")
                                    .setNegativeButton("Retry", null)
                                    .create()
                                    .show();
                        }
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            };

            RegisterRequest registerRequest = new RegisterRequest( username, password, responseListener);
            RequestQueue queue = Volley.newRequestQueue(RegisterActivity.this);
            queue.add(registerRequest);
        }
    });
}

}
</code></pre>

<p>activity_register.xml :</p>

<pre><code> &lt;Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Register"
    android:id="@+id/bRegister"
    android:layout_below="@+id/etPassword"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_marginTop="56dp"
    android:layout_alignRight="@+id/etPassword"
    android:layout_alignEnd="@+id/etPassword"
    android:clickable="true"
    android:onClick="OnClickListener" /&gt;
</code></pre>

<p>RegisterRequest :</p>

<pre><code>import com.android.volley.Response;
import com.android.volley.toolbox.StringRequest;

import java.util.HashMap;
import java.util.Map;

public class RegisterRequest extends StringRequest {

 private static final String REGISTER_REQUEST_URL = "http://app.comxa.com/register.php";
private Map&lt;String, String&gt; params;

 public RegisterRequest(String username, String password, Response.Listener&lt;String&gt; listener){
    super(Method.POST, REGISTER_REQUEST_URL, listener, null);
    params = new HashMap&lt;&gt;();
    params.put("username", username);
    params.put("password", password);
}

@Override
public Map&lt;String, String&gt; getParams() {
    return params;
}
}
</code></pre>