title: Change in getConnection Method Using Volley
body: <p>I'm using getConnection method in my program and I want to restore the response in a variable like "String result " in-order to use in another class, but I don't know how I must change the method. Does anyone have an idea?.</p>
  
  <pre><code>public class Webservice {
   public static void getConnection(Context context, String url){
  
      RequestQueue queue = Volley.newRequestQueue(context);
      StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
              new Response.Listener&lt;String&gt;() {
                  @Override
                  public void onResponse(String response) {
                      Log.i("TEST", "Response is: "+ response);
                  }
              }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              Log.i("TEST","That didn't work!");
          }
      });
      queue.add(stringRequest);
  
   }
  }
  </code></pre>