title: passing json data downloaded using volley between activities
body: <p>i am trying to pass data loaded into my listview with volley.i know how to pass images and text through activities but not json data.It may be a duplicate question but i wasnt helped with the other responses.
  Below is my activity code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>public class Movies extends ActionBarActivity{
   // Log tag
      private static final String TAG = MainActivity.class.getSimpleName();
   
      // Movies json url
      private static final String url = "http://api.androidhive.info/json/movies.json";
      private ProgressDialog pDialog;
      private List&lt;Movie&gt; movieList = new ArrayList&lt;Movie&gt;();
      private ListView listView;
      private CustomListAdapter adapter;
   @Override
   public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.event);
   
       getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  
   Intent newActivity2=new Intent();
   setResult(RESULT_OK, newActivity2);
      
   listView = (ListView) findViewById(R.id.list);
      adapter = new CustomListAdapter(this, movieList);
      listView.setAdapter(adapter);
  
      pDialog = new ProgressDialog(this);
      // Showing progress dialog before making http request
      pDialog.setMessage("Loading...");
      pDialog.show();
  
      // changing action bar color
      getActionBar().setBackgroundDrawable(
              new ColorDrawable(Color.parseColor("#1b1b1b")));
  
      // Creating volley request obj
      JsonArrayRequest movieReq = new JsonArrayRequest(url,
              new Response.Listener&lt;JSONArray&gt;() {
                  @Override
                  public void onResponse(JSONArray response) {
                      Log.d(TAG, response.toString());
                      hidePDialog();
  
                      // Parsing json
                      for (int i = 0; i &lt; response.length(); i++) {
                          try {
  
                              JSONObject obj = response.getJSONObject(i);
                              Movie movie = new Movie();
                              movie.setTitle(obj.getString("title"));
                              movie.setThumbnailUrl(obj.getString("image"));
                              movie.setRating(((Number) obj.get("rating"))
                                      .doubleValue());
                              movie.setYear(obj.getInt("releaseYear"));
  
                              // Genre is json array
                              JSONArray genreArry = obj.getJSONArray("genre");
                              ArrayList&lt;String&gt; genre = new ArrayList&lt;String&gt;();
                              for (int j = 0; j &lt; genreArry.length(); j++) {
                                  genre.add((String) genreArry.get(j));
                              }
                              movie.setGenre(genre);
  
                              // adding movie to movies array
                              movieList.add(movie);
  
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
  
                      }
  
                      // notifying list adapter about data changes
                      // so that it renders the list view with updated data
                      adapter.notifyDataSetChanged();
                  }
              }, new Response.ErrorListener() {
                  @Override
                  public void onErrorResponse(VolleyError error) {
                   if (error instanceof NoConnectionError){
                      Toast.makeText(getBaseContext(), "Bummer..There's No Internet connection!", Toast.LENGTH_LONG).show();
  
                  }};
              });
  
      // Adding request to request queue
  ParseApplication.getInstance().addToRequestQueue(movieReq);
  }
  
  @Override
  public void onDestroy() {
      super.onDestroy();
      hidePDialog();
  }
  
  private void hidePDialog() {
      if (pDialog != null) {
          pDialog.dismiss();
          pDialog = null;
      }
      listView.setOnItemClickListener(new AdapterView.OnItemClickListener(){ 
  
       @Override
       public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                               int position, long id) { 
        
        Intent intent = new Intent(Movies.this, Detail.class);     
           startActivity(intent);
       }
       });}
  
  @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;
  }
  
  
  
      }
   </code></pre>
  </div>
  </div>
  </p>
  
  <p>I am supposed to implement this code snippet when passing the param:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>intent.putExtra("json",jsonobj.toString());</code></pre>
  </div>
  </div>
  </p>
  
  <p>and on my second activity;</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>JSONObject obj=new JSONObject(getIntent().getStringExtra("json")</code></pre>
  </div>
  </div>
  </p>
  
  <p>But i dont get what to replace "json",jsonobj.toString() with from my own activity code.please help.</p>
  
  <p>Thanks in advance</p>