您的位置:首页 > 移动开发 > Android开发

using Broadcast Receivers to listen outgoing call in android note

2011-04-28 09:46 483 查看
1.reference url

http://www.krvarma.com/posts/android/detecting-incoming-and-outgoing-calls-in-android/

2.add permission in Manifest.xml

View Code

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent dialIntent=new Intent(Intent.ACTION_CALL,Uri.parse("tel:13724560911"));
startActivity(dialIntent);

//        TelephonyManager tm = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE);
//        PhoneStateListener phoneListener=new PhoneStateListener();
//        //phoneListener.onCallStateChanged(state, incomingNumber)
//        tm.listen(phoneListener, phoneListener.LISTEN_CALL_STATE);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐