简体   繁体   English

拨打钛金号码而无需打开拨号盘

[英]Calling on a number in titanium without opening dial pad

I have a simple issue, when i use 我使用时有一个简单的问题

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.

I added the permissions in AndroidManifest.xml as 我在AndroidManifest.xml中添加了以下权限:

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

but it is not working still going ask the user to press the call button.Any one have idea of this please help. 但是仍然无法正常工作,要求用户按下通话按钮。任何对此有想法的人都可以帮助。

Ali. 阿里

That should be in your tiapp.xml, slightly differently: 那应该在您的tiapp.xml中,稍有不同:

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

And then use intents to open the dialer: 然后使用意图打开拨号器:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM