/** Get the number of finished transfers, including error and success. */ private int getClearableCount() { Log.i(TAG, "getClearableCount ++"); int count = 0; try { if (mTransferCursor.moveToFirst()) { while (!mTransferCursor.isAfterLast()) { int statusColumnId = mTransferCursor.getColumnIndexOrThrow(BluetoothShare.STATUS); int status = mTransferCursor.getInt(statusColumnId); if (BluetoothShare.isStatusCompleted(status)) { count++; } mTransferCursor.moveToNext(); } } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } Log.i(TAG, "getClearableCount return " + count); return count; }