Reset, move to previous webpage, and remove action bar in Sketchware

1. How to create a reset button in Sketchware?

If you have an app which takes written input and has one or more Edittext widgets being used, you can use a reset button in your app which clears all the inputs in Edittext view. The method is very simple. Simply insert a new button in your view field and name it as reset. Then in it's logic set all Edittext to blank. The picture​ below shows an example.
Now when you click the reset button, it will render all edittext fields blank.

2. How to enable going back or going to previous page in webview?

In webview if you have not used any code other than loadurl, the app exits on pressing back button on any webpage. To prevent that, in the logic of the app, use onBackPressed event and in that use following code:

if WebView ......... canGoBack then
      WebView.......... goBack
else
      Finish Activity

On using this code, if there is a webpage history, your app will lead you to a previous page of pressing back button on mobile, and in case of no history, it will exit the app.
3. How to remove action bar from any page in your app?

To remove action bar from any page, click on the menu at top right corner in Sketchware, go to View Manager, select your xml page and change theme to NoActionBar. This will remove action bar from that page in your app.

Comments

Post a Comment

Popular posts from this blog

A Flash Light App in Sketchware

Create Music Player app in Sketchware

Simple car racing android game in Sketchware

In Sketchware: How to create a calculator for any simple formula?

Firebase auth in Sketchware for Login Activity