Adding an Activity

As soon as your app becomes more advanced, you need to add further activities to it. Doing this is simple. Just add a sub class of org.remoteui.webapp.WebActivty annotated with org.remoteui.annotation.Activity to your project.

Java
Groovy
Kotlin
@Activity(id="second")
public class SecondActivity extends WebActivity {
}
@Activity(id="second")
class SecondActivity extends WebActivity {
}
@Activity(id="second")
class SecondActivity : WebActivity() {
}

Within your MainActivity use the startActivity method to start the second activity by its id.

Java
Groovy
Kotlin
startActivity("second");
startActivity("second")
startActivity("second")

To use the simple mechanism with annotations, the newly created class must be in Spring's search path. Typically, this can be achieved by putting the activity in the same or a sub-package to your *Application class that contains the main method.

Stopping an Activity

Use the finish method to stop an activity. The framework will end it and call its optional onStop method.

Java
Groovy
Kotlin
finish();
finish()
finish()

results matching ""

    No results matching ""