Make code expandable

Hello, I’m starting to learn Java, and I want to make this code extensively, how can I do that? This is the code:

When instead of your text there will be text that he will insert in the extension. (Let there be a block that receives the text for the variable that is defined there, and another block that will run this code.)

Toast.makeText(MainActivity.this,"Your Text",Toast.LENGTH_LONG).show();
2 Likes
@SimpleFunction
public void showToast (String text) {
    Toast.makeText(container. $context, text, Toast.LENGTH_LONG).show ();
}
3 Likes

Okay, how do I do this as an extension that will have a block that will receive the text and a block that will run the function? That’s what I asked. (I do not know how to develop extensions, I only know a little Java …).

You can use rush to create extensions. Watch tutorials on youtube.
https://youtube.com/channel/UCSSQg8iowZRTSP4kCypUYdw

2 Likes

Thanks, but I’m not currently at home so the computer is not near me, so I prefer to mess with codes because there is the site of development extensions, and I need it there … If you can help me I would be happy.

What does this code do?

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