One of the first tasks you will probably want to perform is to move from one activity to another or even to open other apps. This can be easily achieved by using an INTENT COMPONENT. This tutorial will cover
1. how to create a new activity(page) in Sketchware
2. how to use the intent component to navigate between activities(pages)
Whenever you want to move, you will need to create an Intent component. Components can be found or created in the components section of your project.
The above picture shows where components can be found. Click the circled red button(it's called a floating action button) to create a component. It is the first component on your left. You can give your component any name... for example "intent" or "i" or "homepage."
Once you have created and named your component... you can then navigate back to your view or activity section so that you can find the right event to place the logic. Before doing anything we will also need to create the new page(activity) to which our intent is supposed to move us to.
Simply follow the arrows in the diagrams to create a new activity.
Now that we have the the second activity which I named page2 we can then go back to our main screen and place our logic. In this case I will place the intent onButton clicked event. So I need to go to button onClick event... follow the arrows in the image below to get to that event.
Place your intent blocks like this.
We can now run our app.... this will be a simple app that alternates between 2 pages.
I hope you found this helpful.
Comments