简体   繁体   中英

app inventor selecting random item from a list one time only

Hi I am creating this app for my internship. It's a palm reading app which was requested for whatever reason to be built using the MIT App Inventor 2.

Everything works great except on my last page which I need it to take ONE Random 'fortune' from my fortunesList and display only that 'fortune' .

I think I have it set correctly to do that, but it keeps blinking / keeps reloading??

thanks in advance...

Here are the blocks I am currently working with:

在此处输入图片说明

set Label1.text to pick a random item get global list

see also the documentation

pick a random item

在此处输入图片说明

Picks an item at random from the list.


EDIT: see screenshot how to do it in your example to pick a random item on each run of the app, then display the picked item in another screen

Screen1 在此处输入图片说明 Screen fortunes

在此处输入图片说明

see also how to work with multiple screens

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM