title: How to get count from table and set as a text on textview in android
body: <p>Hi i am new to android and getting total number of rows from SQlite table and set it as a text to a textview. i  have searched it alot read many related posts but unfortunately can't succeed with it anybody helped me plzzz...</p>
  
  <p>Here is my Query</p>
  
  <pre><code>Cursor cur = mDb.rawQuery(" SELECT Count(*) FROM  Tasks ", null);
           int x = cur.getCount();
              cur.close();
              return x;
  </code></pre>
  
  <p>my java code is</p>
  
  <pre><code>TextView count = (TextView) findViewById(R.id.txtcount);
         count.setText(String.valueOf(myAdapter.GetTasksCount())); 
  </code></pre>
  
  <p>thanks in advance</p>