title: Get random item from Json String
body: <p>I have a Json string .</p>
  
  <p>i would like to get one entry every time i open my app and use them.
  Searching the net, i have created something like this:</p>
  
  <pre><code>ArrayList&lt;HashMap&lt;String, String&gt;&gt; Listads = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
          HashMap&lt;String, String&gt; mapads = new HashMap&lt;String, String&gt;();
          String randomValue = null;
          try {
              for (adsTrend tr : objs.getTrends())
  
              {
  
                  Log.i("ADS",
                          tr.getId() + " - " + tr.getLink() + " - "
                                  + tr.getType() + " - " + tr.getEnabled());
  
                  lv_arr[i] = tr.getId() + " - " + tr.getLink() + " - "
                          + tr.getType() + " - " + tr.getEnabled();
                  i++;
  
                  mapads.put("id", tr.getId());
                  mapads.put("link", tr.getLink());
                  mapads.put("type", tr.getType());
                  mapads.put("enabled", tr.getEnabled());
  
                  Listads.add(mapads);
                  Random generator = new Random();
                  Object[] values = mapads.values().toArray();
                  randomValue = (String) values[generator.nextInt(values.length)];
  
              }
  
  
  
              Toast.makeText(SplashActivity.this,"this is my random value : "+randomValue,Toast.LENGTH_LONG).show();
  </code></pre>