title: Android: Volley request is not working
body: <p>I am new to <strong>android</strong> and <strong>volley</strong>.
  I created one <strong>login program</strong> to fetch <strong>json</strong> data from my server but it is not working.
  It is not showing the <strong>json response</strong> after clicking the <strong>login button</strong>.
  I am pasting my code below.</p>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>package com.volley.cuser.volleyexample;
  
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.TextView;
  
  import com.android.volley.NetworkResponse;
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.JsonObjectRequest;
  import com.android.volley.toolbox.Volley;
  
  public class MainActivity extends Activity {
  
      private TextView txtDisplay;
      EditText editText;
      EditText editText2;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          editText = (EditText) findViewById(R.id.username);
          editText2 = (EditText) findViewById(R.id.password);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
      public void studentLogin(View view) {
          String username = editText.getText().toString();
          String password = editText2.getText().toString();
          RequestQueue queue = Volley.newRequestQueue(MainActivity.this);
          String url = "http://afterklass.in/api/";
          JSONObject js = new JSONObject();
          try {
              JSONObject jsonobject = new JSONObject();
  
              jsonobject.put("email_mobile", username);
              jsonobject.put("passwd", password);
              jsonobject.put("m", "student");
              jsonobject.put("uc", "signin");
              jsonobject.put("signin", "Sign+In");
  
              js.put("data", jsonobject.toString());
  
          }catch (JSONException e) {
              e.printStackTrace();
          }
          JsonObjectRequest jsObjRequest = new JsonObjectRequest(Request.Method.POST, url, js, new Response.Listener&lt;JSONObject&gt;() {
  
              @Override
              public void onResponse(JSONObject response) {
                  // TODO Auto-generated method stub
                  txtDisplay.setText("Response =&gt; " + response.toString());
              }
          }, new Response.ErrorListener() {
  
              @Override
              public void onErrorResponse(VolleyError error) {
                  //String json = null;
  
                  //NetworkResponse response = error.networkResponse;
                  //if(response != null &amp;&amp; response.data != null){
                      //switch(response.statusCode){
                          //case 400:
                              //txtDisplay.setText("Error =&gt; " + response.data);
                              //break;
                      //}
                      //txtDisplay.setText("Error =&gt; " + response.statusCode);
                      //Additional cases
                  //}
                  Log.d("ERROR", error.toString());
              }
          });
  
          queue.add(jsObjRequest);
      }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>activity_main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
      &lt;EditText android:id="@+id/username"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:hint="@string/username" /&gt;
      &lt;EditText android:id="@+id/password"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:hint="@string/password" /&gt;
      &lt;Button
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="@string/login"
          android:onClick="studentLogin" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>AndroidManifest.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.volley.cuser.volleyexample" &gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;'
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>