Home › Forums › FLIR Mobile SDK Development › Android Development › Battery percentage and charging state callbacks not supporting java lambdas
This topic contains 2 replies, has 2 voices, and was last updated by Dani 5 months ago.
Viewing 3 posts - 1 through 3 (of 3 total)
-
Author
Posts
-
Participant
Hi,
I’m trying to receive percentage and charging state callbacks with the new implementation in v1.3.0 where it seems to have changed to rx since the last version.
battery.percentage().subscribe(batteryPercentageListener);
It works without use lambdas, something like this:
OnReceived<Integer> batteryPercentageListener = new OnReceived<Integer>() { @Override public void onReceived(Integer integer) { customizeBatteryPercentage(integer) } };
But if I try to use java lambdas:
OnReceived<Integer> batteryPercentageListener = (OnReceived<Integer>) integer -> runOnUiThread(() -> customizeBatteryPercentage(integer));
Will throw this error:
E/libc++abi: terminating with uncaught exception of type jni::JavaException: java.lang.NoSuchMethodError no non-static method "Lcom/degree2act/degree/view/scan/-$$Lambda$NewSDKScanActivity$fN5oWURRJsbBKe-zySLHPvSkjTo;.onReceived(Lcom/flir/thermalsdk/live/remote/Battery$ChargingState;)V"
This had already happened in the callback of the withImage function of the Camera class.
Dani
KeymasterHi Dani,
Could you please report this error here? You will then be in contact with our technical support team who can give you the best assistance.
Thank you,
Gavin
FLIR Community SupportParticipantHi,
I submitted as a technical support question, but then, what is the purpose of this forum if later we have to repeat the work by writing to technical support?
Dani
-
Author
Posts
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.