Can you help me convert Java code to Thunkable Blocks?

            public void onPageStarted(WebView view, String url, Bitmap favicon) {
                if (type.equals("Register") && url.contains("/Mobile/Register/Register")) {
                    String referralCode = ShareReference.REFERRAL_CODE;
                    if (referralCode.equals("")) {
                        referralCode = "";

Hi @vickycode87xrf6 :wave:

Thanks for reaching out. If you can post a text description of what this code is supposed to do, I’m imagining you’ll get a much quicker and more meaningful response. We are here to help but the majority of us don’t know Java.


I need to fix the text in this ID

1 Like

Your code is using an invitation link and extract the referral code from the link to give credit to the one who invited you. This code and the example you show is not part of Thunkable and therefore you will not find good explanation.

var AgentID = document.querySelector(‘AgentID’);
AgentID.value = ‘Text’;
AgentID.readOnly = true;

Please help, how can I use such a command on thunkable?


You can only use these commands through a Web Viewer Extension

See this example
This is the official Thunkable sample app.


I can’t find import extension

It’s not an .aix file @vickycode87xrf6 it’s actually part of the web viewer component itself.

Here’s more:


Looking at your code i am guesing that you are working with a text input component

This Will return the first HTML element on the page with the given id/class
You already have that block in Thunkable it’s the green block refering to your element/component.

This Will set the text of An text input so you can Use a “set text to” block.

This is not supported by Thunkable.
You can Use a label if you want your text input to be Read only.
Alternativly you can do as @muneer and @domhnallohanlon suggested.

Hope that helps

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.