gpt4 book ai didi

javascript - 用户 ACTION_VIEW Intent 在 APP 中打开 URL

转载 作者:行者123 更新时间:2023-12-01 16:57:48 26 4
gpt4 key购买 nike

我是android新手,正在开发一个我正在使用的小项目

   customerSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(config.tawkto));
startActivity(browserIntent);
}
});

打开我的public static final String tawkto = "https://tawk.to/chat/xxxxxxxxxxxxxxxxxxxxxxxx/default";

那么我如何确保我的 config.tawkto 将在我自己的应用程序中打开,而不是在其他浏览器中打开。

提前致谢。

最佳答案

为此,您必须使用 WebView ,按照以下步骤操作,

  1. 创建新 Activity 并在该 Activity 中使用 WebView
  2. 在该 WebView 中加载您的 config.tawkto 网址
  3. 在您的情况下,当用户单击 customerSupport 按钮时,重定向到该 WebView Activity。

关于javascript - 用户 ACTION_VIEW Intent 在 APP 中打开 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61558975/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com