title: How open a new Activity on a onResponse of Volley
body: <p>I try to open a new activity on a onResponse of Volley. But I have no idea of what parameters I can use. 
  Indeed my Volley request is on another class and, I think I need to pass the context of my first class on the second. But I have no idea of how I can do.</p>
  
  <pre><code>public class ConnexionActivity  extends Activity{
  
  EditText textlogin;
  EditText textpassword;
  Button btnConnexion;
  
  String login;
  String password;
  
  private AllRequest req;
  private PrefManager pref;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.connexion);
  
      this.req = new AllRequest(getApplicationContext());
      this.pref = new PrefManager(getApplicationContext());
  
      textlogin = (EditText) findViewById(R.id.editText_login_connexion);
      textpassword = (EditText) findViewById(R.id.editText_mdp_connexion);
      btnConnexion = (Button) findViewById(R.id.btn_Connexion);
  
      btnConnexion.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              login = textlogin.getText().toString();
              password = textpassword.getText().toString();
  
              req.TokenRequest(login, password);
  
          }
      });
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And that is a part of my function that do the request Volley: </p>
  
  <pre><code>public void TokenRequest(final String login, final String password){
      final StringRequest stringRequest = new StringRequest(com.android.volley.Request.Method.POST, ressources.urlToken,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      Log.e("onResponse", response);
                      pref = new PrefManager(context);
  
                      pref.storeIsConnect(true);
  
                      try{
  
                          JSONObject rep = new JSONObject(response);
  
  
  
                          //stockage des données
                          pref.storeScope(rep.getString("scope"));
                          pref.storeTokenType(rep.getString("token_type"));
                          pref.storeAccessToken(rep.getString("access_token"));
                          pref.storeRefreshToken(rep.getString("refresh_token"));
                          pref.storeExpiresIn(rep.getString("expires_in"));
  
                      }catch (JSONException e) {
                          e.printStackTrace();
                          Log.e("erreurJSON", e.getMessage());
                      }
  
                      //I don't know how do this part 
                      Intent intent = new Intent(ConnexionActivity.getContext(), listMirorActivity.class);
                      startActivity(intent);
  
                  }
              }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              Log.e("onErrorResponse", error.toString());
          }
  
  
  
      }){
          @Override
          public Map&lt;String, String&gt; getParams() throws AuthFailureError {
              HashMap&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
              params.put("grant_type", "password");
              params.put("username", login);
              params.put("password", password);
              return params;
          }
  
          @Override
          public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
              Map&lt;String,String&gt; headers = new HashMap&lt;String, String&gt;();
              // add headers &lt;key,value&gt;
  
              String credentials = ressources.client_id + ":" + ressources.client_secret;
              String auth = "Basic "
                      + Base64.encodeToString(credentials.getBytes(),
                      Base64.NO_WRAP);
              headers.put("Authorization", auth);
              return headers;
          }
      };
  
      queue.add(stringRequest);
  
  }
  </code></pre>