I am trying to use the 2nd value of each of my JSON elemnts and use it in a array of web urls. What I am trying to end of with is a array of urls that include the image names from my json data below.
JSON Data:
[["1","Dragon Neck Tattoo","thm_polaroid.jpg","polaroid.jpg"],["2","Neck Tattoo","thm_default.jpg","default.jpg"],["3","Sweet Tattoo","thm_enhanced-buzz-9667-1270841394-4.jpg","enhanced-buzz-9667-1270841394-4.jpg"]]
MainActivity:
Bundle bundle = getIntent().getExtras();
String jsonData = bundle.getString("jsonData");
try {
//THIS IS WHERE THE VALUES WILL GET ASSIGNED
JSONArray jsonArray = new JSONArray(jsonData);
private String[] mStrings=
{
for(int i=0;i<jsonArray.length();i++)
{
"http://www.mywebsite.com/images/" + jsonArray(i)(2),
}
}
list=(ListView)findViewById(R.id.list);
adapter=new LazyAdapter(this, mStrings);
list.setAdapter(adapter);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}