Fix some crashes after DB refactor

This commit is contained in:
Sylvia van Os
2021-12-16 22:49:22 +01:00
parent 34fcedfa28
commit d4e388cf5d
2 changed files with 11 additions and 2 deletions

View File

@@ -18,12 +18,14 @@ import androidx.recyclerview.widget.RecyclerView;
*/
public class CardShortcutConfigure extends AppCompatActivity implements LoyaltyCardCursorAdapter.CardAdapterListener {
static final String TAG = "Catima";
final SQLiteDatabase mDatabase = new DBHelper(this).getReadableDatabase();
private SQLiteDatabase mDatabase;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
mDatabase = new DBHelper(this).getReadableDatabase();
// Set the result to CANCELED. This will cause nothing to happen if the
// aback button is pressed.
setResult(RESULT_CANCELED);

View File

@@ -28,7 +28,14 @@ public class CardsOnPowerScreenService extends ControlsProviderService {
public static final String PREFIX = "catima-";
static final String TAG = "Catima";
private final SQLiteDatabase mDatabase = new DBHelper(this).getReadableDatabase();
private SQLiteDatabase mDatabase;
@Override
public void onCreate() {
super.onCreate();
mDatabase = new DBHelper(this).getReadableDatabase();
}
@NonNull
@Override