sorting listview according to date from web service in android
<p>I have a listview from web service with name &amp; date as list item per line.i need to sort this listview according to date in android.How could i do that?</p>

<p>code i used:</p>

<p>protected String doInBackground(String... args) {</p>

<p>....</p>

<pre><code>        for (int i = 0; i &lt; nl.getLength(); i++) {
            // creating new HashMap

            HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
            Element e = (Element) nl.item(i);
            // adding each child node to HashMap key =&gt; value
            map.put(Constants.REQUEST_ID,   webCall.parser.getValue(e, "name"));
            map.put(Constants.KEY_DATE, webCall.parser.getValue(e, "Date"));

            // adding HashList to ArrayList
            menuItems.add(map);
        }
        return null;

    }

    protected void onPostExecute(String file_url) {
        // dismiss the dialog after getting all products

        // updating UI from Background Thread
        runOnUiThread(new Runnable() {
            public void run() {
                ListAdapter adapter = new SimpleAdapter(this,menuItems, R.layout.list_item, new String[] {
                                Constants.REQUEST_ID, Constants.KEY_DATE

                                }, new int[] {
                                R.id.id, R.id.name});

                setListAdapter(adapter);
</code></pre>

<p>Thanks.</p>
