I don't want to use java VERSION_1_8
in my module.
but in a snippet code from a library it using this code :
RxPaparazzo.takeImage(this)
.crop(options)
.size(size)
.usingGallery()
.subscribe(response -> {
if (response.resultCode() != Activity.RESULT_OK) {
response.targetUI().showUserCanceled();
return;
}
// Log.e("response",response.data());
response.targetUI().loadImage(response.data());
});
now how can I change it to simple java function expression ?
If you are using a lambda expression as an anonymous function but not doing anything with the argument passed, you can replace lambda expression with method reference. In the first two cases, the method reference is equivalent to lambda expression that supplies the parameters of the method e.g. System.
You can change it to anonymous class using the following trick in Android Studio
Screenshot to explain:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With