I’m trying to add text to the main screen from other class, I tried to pass screen object from the class that extend MainScreen but when I try to add something to it, it gives me Permission denied exception. What is the right way to add for example text filed to the main screen from different class?
Edit:
public TheMainClass extends MainScreen
{public TheMainClass() { LabelField labelField = new LabelField("Hello"); add(labelField); } }public OtherClass{
public OtherClass(){ // i want to add new LabelField here to say for example "World!" to the // TheMainClass screen } }
There are many ways to do this, one would be:
Of course you will have to ensure that the call to addLabelTo is executed on the event thread.