Use findDevice() instead of getDevice() when you want to delete it

This commit is contained in:
cpfeiffer 2016-09-30 21:27:33 +02:00
parent 1fd6b59bf8
commit f44974c215
1 changed files with 1 additions and 1 deletions

View File

@ -377,7 +377,7 @@ public class ControlCenter extends GBActivity {
} }
try (DBHandler dbHandler = GBApplication.acquireDB()) { try (DBHandler dbHandler = GBApplication.acquireDB()) {
DaoSession session = dbHandler.getDaoSession(); DaoSession session = dbHandler.getDaoSession();
Device device = DBHelper.getDevice(gbDevice, session); Device device = DBHelper.findDevice(gbDevice, session);
if (device != null) { if (device != null) {
long deviceId = device.getId(); long deviceId = device.getId();
QueryBuilder qb; QueryBuilder qb;