title: order by date in sqlite database example in android 2.0.3
body: <p>In android 2.0.3 i want a suggestion how to make my cursor data in descending order.i know in sqlite dates are stored in text but i retrieved the cursor and parse the date but than im not able to sort them in descending order..needed help..
  this is my code if some can help</p>
  
  <p>int cnt=rs_inc.getCount();</p>
  
  <pre><code>                String d[]=null;
                  SimpleDateFormat formatter ; 
               Date date1 = null,date2 = null ; 
                formatter = new SimpleDateFormat("dd-mm-yy");
               boolean swap = true;
                      while(swap)
                      {
                          swap = false;           
                          for(int i =1; i &lt; cnt; i++) 
                          {
                          d[i]=rs_inc.getString(2);
                           try {
                                  date1 = (Date)formatter.parse(rs_inc.getString(2));
                                  }catch(Exception e){}
                                  rs_inc.moveToNext();
                                  if(rs_inc.isAfterLast()){
                                      rs_inc.moveToPrevious();
                                  }
  
                                  d[i+1]=rs_inc.getString(2);
                           try {
                                  date2 = (Date)formatter.parse(rs_inc.getString(2));
                                  }catch(Exception e){}
                              if(date1.before(date2))     
                              {
                                  swap = true;    
                                  String temp = d[i];     
                                  d[i] = d[i + 1];    
                                  d[i + 1] = temp;        
                              }
                          }
                      }
  </code></pre>