【问题标题】:User ACTION_VIEW Intent to open URL In APP用户 ACTION_VIEW 意图在 APP 中打开 URL
【发布时间】:2020-08-16 21:59:40
【问题描述】:

我是 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 将在我自己的应用程序中打开,而不是在其他浏览器中。

提前致谢。

【问题讨论】:

    标签: javascript java android android-studio android-layout


    【解决方案1】:

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

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

    【讨论】:

    猜你喜欢
    • 2021-09-02
    • 2019-07-22
    • 1970-01-01
    • 2023-02-21
    • 1970-01-01
    • 2016-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多