Skip to main content
added 288 characters in body
Source Link
Rob Audenaerde
  • 3.5k
  • 15
  • 24

There is a lot going on in your code, but this struck me first:

If / do / while

if (cursor.moveToFirst()) {
    do {
     .....
    } while (cursor.moveToNext());
}

This can be written as:

while (cursor.moveToFirst()) {
     .....
}

Static / Casing?

This is something you should never see:

db.EPG_TABLE

Either EPG_TABLE is static on DatabaseHandler, in which case you should access it using DatabaseHandler.EPG_TABLE. Or it is a field, and then it should be camelCase.

There is a lot going on in your code, but this struck me first:

if (cursor.moveToFirst()) {
    do {
     .....
    } while (cursor.moveToNext());
}

This can be written as:

while (cursor.moveToFirst()) {
     .....
}

There is a lot going on in your code, but this struck me first:

If / do / while

if (cursor.moveToFirst()) {
    do {
     .....
    } while (cursor.moveToNext());
}

This can be written as:

while (cursor.moveToFirst()) {
     .....
}

Static / Casing?

This is something you should never see:

db.EPG_TABLE

Either EPG_TABLE is static on DatabaseHandler, in which case you should access it using DatabaseHandler.EPG_TABLE. Or it is a field, and then it should be camelCase.

Source Link
Rob Audenaerde
  • 3.5k
  • 15
  • 24

There is a lot going on in your code, but this struck me first:

if (cursor.moveToFirst()) {
    do {
     .....
    } while (cursor.moveToNext());
}

This can be written as:

while (cursor.moveToFirst()) {
     .....
}