How to link to a website

Hey i am trying to make an app that when you click a button with your city it shows a website. How can i do that?

Dynamically or preset ?

what do you mean by that? the website already exists i just want to make that when you click a button it takes you there

like i will have like 20 buttons and i want each one to take you to a different website

See here for some ideas on what to do

https://community.appinventor.mit.edu/t/1-screen-many-webview-loading-is-very-long/43596/14

Consider using a spinner or list picker instead of 20 buttons, and just one webviewer.

with regard to:

what do you mean by that?

Just checking that if you clicked on a button with the test London on it, a search was done and automatically returned a website with London in the name. I sounds like you will preset the website locations.

2 Likes

thank you ill try that! yeah i am using a website as a preset. Thanks for your help!

i have one more question tho how to make it that when i choose something from list picker it goes to the website. I made the list and stuf so far and i added the webviewer but how do i make it that when i choose a city it goes to the certain website

You need either:

  • two lists in alignment, one for the cities and one for the respective websites. Use the index from the selected city to run the website for that city

or

  • one list of lists, with the city and website for that city in pairs. Then use the look up in pairs blocks to return the website
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.