2016년 12월 4일 일요일

how to transfer an action from one screen to another screen


I have already designed my app now, but i try to figure out a problem.

i build a turn on and turn off button on the first screen. And i want to show the on/off status on the second screen. How should i do?

I have already uploaded two screenshot. As the figure shows, the first one is the screen 1 which has On/Off button. When i click the ON or OFF then i want to show the LED is ON or OFF on the second screen and list below the check information box.

1.PNG 표시 중

2.PNG 표시 중

-- 
How to pass values from one screen to another screen

Use different screens wisely
Before starting to create another screen, first you should think about is it really necessary? See also Building apps with many screens and SteveJG's post about advantages/disadvantagesbecause in only one screen you also can use vertical arrangements to simulate different screens, just set the arrangements to visible = true/false as needed... See also Martyn_HK's example about how to use Tabs in App Inventor and another example from Cyd.
      
The recommended method of switching screens in AppInventor

-- 
First of all, thanks for your replying.

However, my idea is when i click ON or OFF button, the second screen will show "THE LED IS ON/OFF." I have already tried to use those idea, but it doesn't work.

-- 
There's no real time communication between screens. What you have to do is what Taifun showed you in his link.
Is like this. You have a house than can only have one person at a time inside. If you want the next person coming after you to do something, you need to leave him a note. He will never know what to do in the house until he gets inside and reads your note.

Screens works the same. You need to leave a "note" in the current screen and when the next screen opens, you read that "note" and set the ON/OFF switch to whatever you wrote in the note.

Please read the link Taifun gave you to learn how to leave these "notes" for the other screens.

-- 


댓글 없음:

댓글 쓰기