JSONObject get Image/Populate BaseAdapter
<p>I need to populate my baseadapter.<br>
I parse my JSONArray, but I have problem to put the image into my baseadapter.<br>
The timestamp and name works good.<br>
How can i do this?<br>
I need to have a list of post:<br>
AVATAR - Nickname<br>
Image<br>
timestamp<br></p>

<pre><code>public class Latest extends Activity {

public Latest() {
    // TODO Auto-generated constructor stub
}

keepClient keep = new keepClient();
HttpClient client = keep.startClient();
HttpResponse response = keep.getHttpResponse();
HttpEntity entity;
String url = "http://blablabl.getvlalalal.get.com";
String username ="user";
String password = "password";
String json = null;
JSONArray myArray = null;
JSONObject myObject = null;
ArrayList&lt;Post&gt; postList = new ArrayList&lt;Post&gt;();
ArrayList&lt;HashMap&lt;String, Object&gt;&gt; data = new ArrayList&lt;HashMap&lt;String,Object&gt;&gt;();

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.latest);
    try {
        keep.doLogin(username, password, client);
        json = URLreader(url, entity);
        JSONArray ja = new JSONArray(json);
        myArray = ja.getJSONArray(1);
        postList = PostList(myArray.length(), myArray);
        String[] from = {"profile_image", "name", "item", "timestamp"};
        int[] to = {R.id.avatar,R.id.fullname,R.id.purchase ,R.id.timestamp};
        SimpleAdapter adapter=new SimpleAdapter(
                getApplicationContext(),
                data,
                R.layout.latestrow,
                from,
                to);
        ((ListView)findViewById(R.id.latestwrapper)).setAdapter(adapter);
    } catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

ArrayList&lt;Post&gt; PostList (int index, JSONArray myArray) throws JSONException, MalformedURLException {
    ArrayList&lt;Post&gt; posts_list = new ArrayList&lt;Post&gt;();

    for (int i = 0; i &lt; index; i++) {
        myObject = myArray.getJSONObject(i);
        posts_list.add(createPost(myObject));
        HashMap&lt;String, Object&gt; postMap = new HashMap&lt;String, Object&gt;();
        postMap.put("profile_image", posts_list.get(i).getProfile_Image());
        postMap.put("name", posts_list.get(i).getName());
        postMap.put("item", new URL(posts_list.get(i).getItem()));
        postMap.put("timestamp", posts_list.get(i).getTimeStamp());
        data.add(postMap);
    }

    return posts_list; 
}

Post createPost(JSONObject jo) throws JSONException{
    String profile_image, name, item, timestamp;
    profile_image = jo.getString("image");
    name = jo.getString("name");
    item = jo.getString("thumbnail");
    timestamp = jo.getString("timestamp");

    Post post = new Post(profile_image, name, item, timestamp);
    return post;
}
</code></pre>
