Advertisement
rickyc81

Untitled

Sep 4th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. private void recuperaNumeroRecord() {
  2.             // Chiediamo l'accesso al db
  3.             SQLiteDatabase db = DatabaseHelper.getReadableDatabase();
  4.  
  5.             // Query per recuperare il numero di righe presenti nel db
  6.             final String sql = "SELECT COUNT(*) FROM assist_rubrica";
  7.  
  8.             Cursor c = db.rawQuery(sql, null);
  9.  
  10.             if (c.moveToFirst()) {
  11.                 final TextView tView = (TextView) this
  12.                         .findViewById(R.id.mainTextViewNumeroRecord);
  13.                 tView.setText(c.getString(0));
  14.                
  15.                 System.out.println("Numero record recuperato!");
  16.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement