title: show listview in the second activity
body: <p>In my first <code>Activity</code> I have a list of elements, and every time I clicked on a row in my list, I take two elements from the list and pass the elements of a second activity to Fill A Url.</p>
  
  <p>I analyze the result of JSON in a <code>ListView</code> (like a shopping cart) then a button that lets you see the list of the second activity without worrying about the URL, just showing the list of elements.</p>
  
  <p>The problem is when I click on the button to show me the list. My second activity still waiting for the two items to fill the URL and I don't want that.</p>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>     TextView texto;
              texto = (TextView) view.findViewById(R.id.txtCodigo);
              String text2 = texto.getText().toString();
              Intent intent2= new Intent(busqueda.this,Compra.class);
              intent2.putExtra("TOKENS", datas);
              intent2.putExtra("CODI", text2);
              // startActivity(intent2);
              Toast.makeText(busqueda.this,"Agregado...",Toast.LENGTH_LONG).show();
              return   super.onContextItemSelected(item);
  </code></pre>
  
  <p><strong>Second Activity</strong>  </p>
  
  <pre><code>        protected String doInBackground(Void... params) {
          link = (TextView) findViewById(R.id.textViewNombre);
          code = (TextView) findViewById(R.id.textViewNro);
          prod = new ArrayList&lt;&gt;();
          lista_eligida = (ListView) findViewById(R.id.listView_eligida);
          final Intent intent = getIntent();
          Bundle extras = intent.getExtras();
          String linked = null;
          String coded = null;
          if (extras != null) {
              linked = extras.getString("TOKENS");
              coded = extras.getString("CODI");
          }
  
              String url = "http://www.air-intra.com/apps/air-app/agregar.php?token=" + linked + "&amp;codiart=" + coded + "";
              HttpHandler sh = new HttpHandler();
              JSONObject jsonStr = sh.makeServiceCall(url);
  
              Log.e(TAG, "Response from url: " + jsonStr);
              try {
  
  
                  JSONObject jsonObj = new JSONObject(String.valueOf(jsonStr));
                  String nroComp= jsonObj.getJSONObject("PR").getString("nrocompro");
                  String Nomb= jsonObj.getJSONObject("PR").getString("nombre");
                  String code= jsonObj.getJSONObject("PR").getString("codigo");
                  recode=""+code;
                  reNombre=""+Nomb;
                  reNumero=""+nroComp;
                  Log.e("CODE", recode);
  
                  JSONArray contacts = jsonObj.getJSONArray("PRR");
                  for (int i = 0; i &lt; contacts.length(); i++) {
                      JSONObject c = contacts.getJSONObject(i);
  
                      String codig = c.getString("codigo");
                      String des = c.getString("descrip");
                      String prec = c.getString("precio");
                      // String garb = c.getString("fisicolug");
  
                      HashMap&lt;String, String&gt; contacto = new HashMap&lt;&gt;();
                      contacto.put("codigo", codig);
                      contacto.put("descrip", des);
                      contacto.put("precio", prec);
                      //contact.put("fisicolug", garb);
  
                      prod.add(contacto);
  
                  }
              } catch (final JSONException e) {
  
              }
          return null;
      }
          @Override
          protected void onPostExecute (String result){
              if (pDialog.isShowing())
                  pDialog.dismiss();
              super.onPostExecute(result);
  
              codigo.setText(recode);
              nombre.setText(reNombre);
              numero.setText(reNumero);
              final ListAdapter adapter = new SimpleAdapter(Compra.this, prod,
                      R.layout.item_carrito, new String[]{"codigo", "descrip", "precio"},
                      new int[]{R.id.tvcode, R.id.tvdescrip, R.id.tvprec});
              lista_eligida.setAdapter(adapter);
  
          }
  
  }
  </code></pre>