如何拨打乌里方法特殊的字符? [英] how to dial special charaters in Uri method?

查看:166
本文介绍了如何拨打乌里方法特殊的字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在做一个应用程序自动/通过短信所有人都只是一些分析字符的呼叫转移code的工作激活呼叫转移。

Hi I'm making an application to automate/activate call forwarding via sms all are working except of parsing some characters for the call forwarding code..

这是我的code执行呼叫转移code这是记录在这里:的 http://en.wikipedia.org/wiki/Call_forwarding#Keypad_$c$cs

this is my code to execute the call forwarding code which is documented here: http://en.wikipedia.org/wiki/Call_forwarding#Keypad_codes

Intent callIntent = new Intent(Intent.ACTION_CALL);
                callIntent.setData(Uri.parse("tel:"+Uri.encode("#")+Uri.encode("#")+"21"+Uri.encode("#")));
                ((Intent)callIntent).addFlags(268435456);
                this.context.startActivity((Intent)callIntent);

在code取消呼叫是## 21#,但我的应用程序始终得到了一个错误,看上去就像是贴上面不能读我的命​​令,但如果我将它拨手动这是很好..

the code to cancel the call is ##21# but my application always got an error and looks like it cannot read my command as posted above but if I will dial it manually it is fine..

推荐答案

尝试使用ACTION_DIAL而非ACTION_CALL为** 21 * ##和21#。结果
看看这个链接还有,我觉得它专门解决你的问题。

Try using ACTION_DIAL rather than ACTION_CALL for the **21* and ##21#.
Check out this link as well, I think it addresses your problem specifically.

这里的TLDR:

String uri = "**21*268435456#";   // ##21#268435456#  
Intent intent = new Intent(Intent.ACTION_DIAL); // ACTION_CALL  
Uri uri2 = Uri.fromParts("tel", uri, "#");  
intent.setData(uri2);  
startActivity(intent);  

这篇关于如何拨打乌里方法特殊的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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