How to get count from table and set as a text on textview in android

view story

http://stackoverflow.com – 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... Here is my Query Cursor cur = mDb.rawQuery(" SELECT Count(*) FROM Tasks ", null); int x = cur.getCount(); cur.close(); return x; my java code is TextView count = (TextView) findViewById(R.id.txtcount); count.setText(String.valueOf(myAdapter.GetTasksCount())); thanks in advance (HowTos)