如何在 App Inventor 中打开网页

问题描述 投票:0回答:3

我有一个网络查看器,它是主要应用程序,网络查看器下方是一个按钮。我想在单击按钮时在用户的网络浏览器中打开一个网页。我如何在 App Inventor 中执行此操作?

Action: android.intent.action.VIEW 
DataUri: http://example.com 

文档中的上述操作不起作用。

android mobile-application app-inventor
3个回答
5
投票

将 ActivityStarter 添加到屏幕并配置其属性:

ActivityStarter1
Action:android.intent.action.VIEW
DataUri:http://example.com 

将其他属性留空。

enter image description here

同屏,配置按钮的事件处理程序,调用activityStarter1.StartActivity:

enter image description here

按下按钮,网络浏览器将打开,页面为 http://example.com

enter image description here


0
投票

这是最好的问题,也是最好的答案。找了好久了,非常感谢。


-1
投票

使用活动启动器和操作

android.intent.action.VIEW

data URI
是您要打开的网站。

然后使用:

call ActivityStarter1.StartActivity
© www.soinside.com 2019 - 2024. All rights reserved.