android.permission.CALL_PHONE 平板电脑 [英] android.permission.CALL_PHONE for tablets

查看:30
本文介绍了android.permission.CALL_PHONE 平板电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,在清单中我有:

I am developing an app and in the manifest I have:

<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>

当我点击按钮执行这段代码时:

When I click on the button to execute this code:

Intent intentcall = new Intent();
intentcall.setAction(Intent.ACTION_CALL);
intentcall.setData(Uri.parse("tel:" + phonenumber)); // set the Uri
startActivity(intentcall);

它可以在手机上正常运行,在平板电脑上它会弹出一个显示屏,您可以在其中查看号码或将号码添加到联系人.但是,如果我在清单中保留许可,则市场上的平板电脑无法使用它.我怎样才能保持代码行为并且仍然在平板电脑和手机市场上显示它?

It will run fine on phones, and on tablets it pops up with a display where you can view or add the number to contacts. However, if I keep the permission in the manifest, it isn't available for tablets in the market. How can I keep the code behavior and still have it display in the market for tablets as well as phones?

推荐答案

关于uses-feature"及其崩溃 - 您是否在实际拨打电话之前检查电话是否可用?当应用程序在平板电脑上时,您可能需要为这种情况执行额外的步骤.您在清单中所说的只是该功能不是必需的.它可能依赖于您实际实现相关逻辑.

Regarding "uses-feature" and it crashing - are you checking that telephony is available before actually making the call? It might be you need to do that extra step for the case when the app is on tablets. All you are saying in the manifest is that the feature is not required. It probably relies on you to actually implement the logic around that.

这篇关于android.permission.CALL_PHONE 平板电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆