title: How to set cursor retrieved data to text view in Android
body: <p>i have retrieved some values from DB using the query which is given below.</p>
  
  <pre><code>public Cursor getcredittranscation(String date)
  {    
      String sql="SELECT A.Acc_No,A.Cust_Name, T.Trans_Amnt FROM TransactionTable "
                  + "T LEFT JOIN AccMaster A on A.Acc_ID = T.Acc_ID "
                  + "WHERE T.Trans_Date =? AND T.Trans_Type=? ORDER BY  T.Entry_Time asc";
      Cursor cursor = db.rawQuery(sql, new String[]{date, "credit"});
  
      return cursor;
  }
  </code></pre>
  
  <p>And in main activity i want to show these results as a report. Activity code is as given below.</p>
  
  <pre><code>try {
      db.open();
  
      Cursor cur = db.getcredittranscation(temp);
      if(cur.moveToFirst()){
          do{
              DisplayCreditdetails(cur);
          }while(cur.moveToNext());   
      }
      db.close();
  } catch (Exception e) {
      // TODO: handle exception
      Log.e("Retrive Credit Error ", " "+e.getMessage());
  }
  
  private void DisplayCreditdetails(Cursor cur)
  {
      String tempstr = " ";
      tempstr ="  "+tempstr +"\t"+ cur.getString(0) + "\t\t\t"
                  + cur.getString(1) + "\t\t\t" + cur.getString(2);
      credView.setText(tempstr);
  
      Log.e("Credit", "Acc No :"+cur.getString(0) +"Name :"+cur.getString(1)+ "Trans Amnt :"+cur.getString(2));
  } 
  </code></pre>
  
  <p>In log, everything is showing. But in textview only the last value is showing.. what is wrong in my code ??</p>