title: Delphi 10.2 Android App - callback (JHandle) of JAR object
body: <p>I have been struggling with callback and TJHandle for a couple of days with the Zebra 220 printer (I use their SDK).</p>
  
  <p>I have this code:</p>
  
  <pre><code>TPrintCallback = class (TJavaLocal, JHandler_Callback)
  function handleMessage (msg: JMessage): Boolean; cdecl;
  end;
  
  TfrmMain = class (TForm)
  [..]
  private
  FCallback: TPrintCallback;
  FHandler: JHandler;
  end;
  [...]
  procedure TfrmMain.FormCreate (Sender: TObject);
  begin
  FCallback: = TPrintCallback.Create;
  FHandler: = TJHandler.JavaClass.init (FCallback);
  FPrinter1: = TJMobilePrinter.JavaClass.Init (TAndroidHelper.Context,FHandler, TJLooper.JavaClass.getMainLooper);
  [...]
  end;
  
  function TPrintCallback.handleMessage (msg: JMessage): Boolean;
  begin
  Result: = True;
  ShowMessage (msg.what.ToString + '' + msg.arg1.ToString);
  end;
  </code></pre>
  
  <p>And the code generates this error: Project NextMobileApp.apk raised exception class EJNIFatal with message 'Invoke error: method' handleMessage 'not found'.</p>
  
  <p>Do you have any idea why?</p>