Bart Kindt 5 Posted November 29, 2023 In my Android app, in the Service, I have code which in Delphi 12 no longer works, and I don't understand why: Type TLocationListener = class; // <<<<[DCC Error] DTBU.pas(39): E2291 Missing implementation of interface method JLocationListener.onFlushComplete // Then in TDTBThread: locationListener : TLocationListener; // then further down: type TLocationListener = class(TJavaLocal, JLocationListener) public constructor Create; procedure onLocationChanged(location: JLocation); overload; cdecl; procedure onLocationChanged(locations: JList); overload; cdecl; procedure onProviderDisabled(provider: JString); cdecl; procedure onProviderEnabled(provider: JString); cdecl; procedure onStatusChanged(provider: JString; status: Integer; extras: JBundle); cdecl; end; The code is from years ago; Should I do it in a different way? Share this post Link to post
Dave Nottage 493 Posted November 29, 2023 1 minute ago, Bart Kindt said: E2291 Missing implementation of interface method JLocationListener.onFlushComplete Your TLocationListener does not implement onFlushComplete, which was added to JLocationListener in Delphi 12: JLocationListener = interface(IJavaInstance) ['{D1CF3FB5-3BCB-4959-98D7-BD4D8F93D839}'] procedure onFlushComplete(requestCode: Integer); cdecl; procedure onLocationChanged(location: JLocation); cdecl; overload; procedure onLocationChanged(locations: JList); cdecl; overload; procedure onProviderDisabled(provider: JString); cdecl; procedure onProviderEnabled(provider: JString); cdecl; procedure onStatusChanged(provider: JString; status: Integer; extras: JBundle); cdecl;//Deprecated end; Share this post Link to post
Bart Kindt 5 Posted November 29, 2023 That fixed it... I had no idea that it was _required_ that the 'missing' procedure had to be added in the final source code, as I am not going to use it... Big thanks Dave. Share this post Link to post