Jump to content

Recommended Posts

Posted

 

 

I have the following code and it works correctly in UnimHTMLFrame, now I would like to execute the function from the click event of a button to pass it a parameter 

 

 <input type="button" value="Say hello" onClick="showAndroidToast('Hello Android!')" />

    <script type="text/javascript">
        function showAndroidToast(toast) {
            Android.showToast(toast);
        }
    </script>
    
 

 

Posted
6 minutes ago, easegura777 said:

now I would like to execute the function from the click event of a button

Hello,

Which button? Please explain more.

Posted
6 minutes ago, easegura777 said:

UnimButton

Try this, for example:

procedure TMainmForm.UnimButton1Click(Sender: TObject);
begin
  (Sender as TUnimButton).JSInterface.JSCall('showAndroidToast', ['Hello'])
end;

 

Posted
13 minutes ago, Sherzod said:

Try this, for example:


procedure TMainmForm.UnimButton1Click(Sender: TObject);
begin
  (Sender as TUnimButton).JSInterface.JSCall('showAndroidToast', ['Hello'])
end;

 

Not found!!

×
×
  • Create New...