How to call another Activity / screen with Java in Totalcross?

1

I'm developing an application with java through a tool called Totalcross and I need to call another screen / actividy but I do not know what code to do this.

Android would be the equivalent of this:

public void ChamaRelatorios(View view){
    Intent intent = new Intent(this, Relatorios.class);
    startActivity(intent);
}
    
asked by anonymous 26.10.2018 / 16:22

1 answer

1

To call a screen in Totalcross is quite simple. If you are in MainWindow and want to call a class that inherits from the container you use this command:

 public void initUI() {
         this.swap(new NomeClasse());
 }

But if you are already in a class that inherits from container and you want to call another one, you use this command here:

 MainWindow.getMainWindow().swap(new NomeClasse());
    
26.10.2018 / 18:56