如何创建应用程序,它可以用拨号盘推出 [英] How to create app which can be launched with dialpad
本文介绍了如何创建应用程序,它可以用拨号盘推出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道我怎么能启动与拨号盘一些code我的Android应用程序。如果你喜欢
#的#3214789650#的#的
从星系它启动angryGps应用。
如何实现?
I wanted to know how can i launch my android app with some code from Dialpad. Like if you
##3214789650##
from your galaxy it launches angryGps application.
How to implement that?
感谢。
推荐答案
尝试this.use广播接收机听呼出号码:
try this.use Broadcast Receivers to listen outgoing call number:
的Manifest.xml
uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
<receiver android:name=".OutgoingCallReceiver">
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL"/>
</intent-filter>
</receiver>
OutgoingCallReceiver.java
public class OutgoingCallReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Bundle bundle = intent.getExtras();
if (null == bundle)
return;
// outgoingNumber=intent.getStringExtra(Intent.ACTION_NEW_OUTGOING_CALL);
String phoneNubmer = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
//START APPLICATION HERE
}
}
这篇关于如何创建应用程序,它可以用拨号盘推出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文