Not execute Volley JSON onResponse function
<p>When I call getData.It seems that it is hard to get the result out from the onResponse. I know it cannot work in this current way. Could anyone help me to settle this problem?</p>

<p><strong>getData()</strong></p>

<pre><code>private void getData(){

    //Creating a string request
    StringRequest stringRequest = new StringRequest(SPINNER_URL, new Response.Listener&lt;String&gt;() {
        @Override
        public void onResponse(String response) {
           // Log.d("Country_name","hi");
            JSONObject j = null;
            try {
                //Parsing the fetched Json String to JSON Object
                j = new JSONObject(response);

                //Storing the Array of JSON String to our JSON Array
                result = j.getJSONArray(JSON_ARRAY);

                Log.v("xxxxx",result.toString());
                String mysh=result.toString().substring(1, result.toString().length()-1);


                JSONArray jsonArray = new JSONArray(mysh);
                //Calling method getCountry to get the country from the JSON Array
                getCountry(jsonArray);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    },
            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {

                }
            });

    //Creating a request queue
    RequestQueue requestQueue = Volley.newRequestQueue(this);

    //Adding request to the queue
    requestQueue.add(stringRequest);
}
</code></pre>