本文介绍了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>

当我点击按钮来执行此code:

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);

这将会运行得很好的手机,并在平板电脑上它会弹出一个显示,您可以查看或号码添加到通讯录。但是,如果我继续允许在清单中,它不适用于在市场上平板电脑。我如何能保持code行为,仍然有它在市场上的平板电脑,以及手机的显示?

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?

推荐答案

关于使用特征,它崩溃 - 你检查电话是可用之前实际进行的电话吗?这可能是你需要做额外的步骤的情况下,当应用程序是在平板电脑上。所有你说的话在清单中是不需要的功能。它可能是依赖于你真正实现上的逻辑。

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为平板电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 19:16