android的call_phone,android.permission.CALL_PHONE for tablets

开发者在构建应用时遇到一个问题:在AndroidManifest中声明了拨打电话的权限,使得在手机上可以正常拨打,但在平板上却会弹出查看或添加联系人的界面。如果保留权限,平板则无法在市场中找到该应用。如何在保持代码行为的同时,确保平板用户也能在市场中找到并正常使用应用?

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

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?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值