Ads Here

Friday, 14 May 2021

skatchware How to Make a Button Open a New Activity

 How to start new Activity on  clicking button (link button to a page)in Android?

This page is about how do I start new Activity on clicking button in Android using skatchware

you can link a button a text and images to a new page or new activity this are steps you need to link a page to a button, text and images 

in previous lesson we have seen how we create our app with out code and adding button, image and text are so easy now we use button to show the next page but it is possible to use image and text also

3 steps to link a button to a new activity or page
step1 put a button, image or text
step2 create a page 
step3 link button to a page or assign it to a new activity


lets start

step1 put a button, image or text 

in order to start, first we have to add button on the front page














as you see in the image it is added


step2 create a page 

in order to create a page we have to press a down arrow to the near of run button as shown in the above photo. then we will press the plus (+) sign and give it a name you like  















then we will get a two pages first one is a page or activity which we added a button and the second one is a page which we will add a text on it 













as we add a text on the second or next page(activity) the next step will be to link the second page to to the button on the first page


step3 link button to a page or assign it to a new activity

 after that we press the button we inserted  a down bar will appear then we will find the button which is  (on click) in under  event column as you see it in the image














when you press onclick button a new page comes, after that you will press add component  on  component section 
















then you will get a components to add then you have to add intent from the list of components then give it intent name













then this will be the last one drag and drop from blew components  to under when clicked component what you see it this image 

when button clicked

intent  [ intent value ]  set activity [ a second page you created]

start activity [ intent value ]

then you have to press the down arrow to set  its specific value and set screen must be a page or activity you created 















after that run the program and you will see your work well 

this all about it if you have questions I will answer just comment me




good luck 






1 comment: