I'm sure you've noticed how most apps display a logo when you open them. That is known as a loading screen. It is a great opportunity for branding purposes and it's an ego boost just to watch your logo. This tutorial will show you how to create a loading screen.
How it works
When we open our main activity, we will use an intent to automatically open our loading screen. Once on our loading screen, we will then use a timer to automatically end the loading activity after 2000 milliseconds. You can adjust this to your desired duration in milliseconds. We will then finish the activity. This removes it from our activity stack and returns us to the previous screen.
Start by creating a new project. If you're not sure how to create a new Sketchware project then click here.
How it works
When we open our main activity, we will use an intent to automatically open our loading screen. Once on our loading screen, we will then use a timer to automatically end the loading activity after 2000 milliseconds. You can adjust this to your desired duration in milliseconds. We will then finish the activity. This removes it from our activity stack and returns us to the previous screen.
Start by creating a new project. If you're not sure how to create a new Sketchware project then click here.
I have created an app and the MainActivity is where I have my main menu.
The first step is to navigate to the onCreate event of my MainActivity and place an intent. If my user has to login, I can use the logic below:
The second step is to create a new activity with the name LoadingscreenActivity. I have formatted my screen to look like this:
On my loading screen's onCreate event, I have created a timer component and placed the following blocks:
This will display the screen for 2000 milliseconds and then finish the activity.
That's all. You can now run your app and check out your loading activity.
That's all. You can now run your app and check out your loading activity.
Comments