public int countAll ( ) { checkTable ( ) ; Cursor mCount = null ; try { mCount = database . rawQuery ( "SELECT COUNT(*) FROM \"" + tableName + "\"" , null ) ; if ( mCount . moveToNext ( ) ) { return mCount . getInt ( 1 ) ; } } finally { if ( mCount != null ) { mCount . close ( ) ; } } return 0 ; }
Just for unit test