Created
September 30, 2020 06:08
-
-
Save melikeeroglu/46e9c5a77c791f18b1cffd90c93645d6 to your computer and use it in GitHub Desktop.
HiAnimals InsertPhoto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void insertPhoto(Photo photo) { | |
state = false; | |
if (mCloudDBZone == null) { | |
Log.w(Constant.DB_ZONE_WRAPPER, "INSERT Photo : CloudDBZone is null, try re-open it"); | |
return; | |
} | |
CloudDBZoneTask<Integer> upsertTask = mCloudDBZone.executeUpsert(photo); | |
if (mUiCallBack == null) { | |
return; | |
} | |
upsertTask.addOnSuccessListener(cloudDBZoneResult -> { | |
state = true; | |
Log.w(Constant.DB_ZONE_WRAPPER, "INSERT USER : upsert " + cloudDBZoneResult + " records"); | |
}).addOnFailureListener(e -> { | |
state = false; | |
mUiCallBack.updateUiOnError("INSERT photo : Insert photo info failed"); | |
}); | |
if (mUiCallBack != null) { | |
mUiCallBack.isDataUpsert(state); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment