0

I am pulling 4 different items from JSON and storing them in a Map and would like to take one of those items (and img URL) and use that in the Universal Image Adapter GridView option. Is this possible?

The example on GitHub utilizes a static String of URLs which in my case will not work for me. My JSON look is in my onPostExecute

for(int i=0;i<_results.length();i++){   

                    JSONObject s = _results.getJSONObject(i);
                    Map<String, String> map = new HashMap<String, String>(2);

                    String myIMG = s.getString("images");
                    String quotes = myIMG.replaceAll("\"", "");
                    String slashes = quotes.replaceAll("\\\\", "");                 
                    String myIMG2 = slashes.split("url:")[1];
                    String myIMG3 = myIMG2.split(",height")[0];
                    String pinner = s.getString("pinner");
                    String pinnerQuotes = pinner.replaceAll("\"", "");
                    String curly = pinnerQuotes.replaceAll("\\}", "");
                    String pinnerName = curly.split("full_name:")[1];

                    map.put("desc", s.getString("description"));
                    map.put("img",  myIMG3);
                    map.put("url", s.getString("link"));
                    map.put("name", pinnerName);

                    _pinData.add(map);

So after this point I somehow need to take myIMG3 and use that in the Universal Image Loader GridView. However, I still need the rest of that info so I can pass it through an onClick to a detailed view that utilizes all of that info for that specific image. If anyone has any suggestions, I would be incredibly grateful.

Shan
  • 3
  • 2
  • add all urls ie myIMG3 in a list then use a UIL or Lazy list to display the images. http://stackoverflow.com/questions/15621936/whats-lazylist. pulling items from json can be done using asynctask – Raghunandan May 01 '13 at 16:32
  • @Raghunandan thanks for the reply. If I do it like this, then I lose the other info that I need to pass to a detail page. Unless I am missing something? – Shan May 01 '13 at 17:08

0 Answers0