【问题标题】:How can I know the android tablet device can use telephony or not?我怎么知道安卓平板设备是否可以使用电话?
【发布时间】:2021-09-24 00:04:11
【问题描述】:

当用户点击电话号码字段时,我的 ANDROID 应用会拨打电话。 但是,在许多平板设备上,用户无法使用电话。

所以我需要像这样更改清单。

<uses-feature android:name="android.hardware.telephony" android:required="false" />

其实这个功能只是附加功能,并不是必须的。 因此,我希望用户在他们的平板设备上使用该应用程序。 并且我将避免在平板设备上拨打电话以避免错误。

我如何知道此设备是否可以拨打电话?

为了您的信息,我在我的应用程序中像这样在 webview 上拨打电话。它在手机设备上运行良好。

WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
myWebView.setWebViewClient(new WebViewClient(){
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        if (url.startsWith("tel:")) {
            Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));
            startActivity(intent);
            view.reload();
            return true;
        }
        view.loadUrl(url);
        return true;
    }
});

【问题讨论】:

    标签: android tablet telephony


    【解决方案1】:

    这可能是重复的并且在这里得到了很好的回答,包括用户安装了一个可以拨打电话的应用程序,而不管设备本身的能力如何(例如 Skype): Android Device phone call ability

    【讨论】:

      猜你喜欢
      • 2014-12-26
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-28
      • 2013-05-31
      相关资源
      最近更新 更多