You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys, is it possible to trigger a callback when saveToFile has finished execution? I've been trying to create a new PendingResult.Callback but can't seem to figure out the proper Callback type.
PhotoResult photoResult = fotoapparat.takePicture();
File f = new File(
getActivity().getExternalFilesDir("photos"),
"newImage.jpg"
);
PendingResult.Callback<?> callback = new PendingResult.Callback<Void>() {
@Override
public void onResult(Void v) {
Log.d(TAG,"SAVE FILE CALLBACK");
}
};
photoResult.saveToFile(f).whenAvailable(callback);
The text was updated successfully, but these errors were encountered:
This is something I overlooked while writing saveToFile(). Fixed.
Now saveToFile expects Callback<Void> instead of Callback<?>. Moreover, I added new method - .whenDone which is exactly the same as whenAvailable but has a name better suited for Void callbacks.
Hey guys, is it possible to trigger a callback when saveToFile has finished execution? I've been trying to create a new PendingResult.Callback but can't seem to figure out the proper Callback type.
The text was updated successfully, but these errors were encountered: