gpt4 book ai didi

android - 在不打开拨号盘的情况下调用钛合金号码

转载 作者:行者123 更新时间:2023-11-29 15:25:33 24 4
gpt4 key购买 nike

我有一个简单的问题,当我使用

var phone_number='12346789';

Titanium.Platform.openURL('tel:'+phone_number);

it goes to dial pad in android i want it to directly dial the call without prompting the user to press the call button.

我在 AndroidManifest.xml 中添加了权限

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

但它仍然无法正常工作,请用户按下通话按钮。任何知道这件事的人请帮忙。

阿里。

最佳答案

这应该在您的 tiapp.xml 中,略有不同:

<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<uses-permission android:name="android.permission.CALL_PHONE" />
</manifest>
</android>

然后使用intents打开拨号器:

var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_CALL,
data: 'tel:1234567'
});
Ti.Android.currentActivity.startActivity(intent);

来源:http://shareourideas.com/2012/09/05/appcelerator-titanium-android-click-to-auto-call/

关于android - 在不打开拨号盘的情况下调用钛合金号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13672696/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com