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
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); }
相关文章推荐
- Broadcastreceiver components are not allowed to bind to services in android
- Using jdbc to access sqlite in Android
- What is EPOLL? EPOLL vs Select call? And How to implement UDP server in Linux using EPOLL?
- android multithread in c/c++ to call JNI
- Using AlarmManager and BroadcastReceiver in Android
- Using gdbserver and arm-eabi-gdb to debug native code in Android
- using iscroll.js and iscroll jquery plugin in android webview to scroll div and ajax load data.
- Android: How to download the latest zip Android Source Code easily and using it in Intellij
- can't call void android.view.View.setElevation(float) on null obj in call to CallVoidMethodV
- Using GPS to get current location in Android
- What is EPOLL? Epoll vs Poll vs Select call ? And How to implement UDP server in Linux using EPOLL?
- Android ReceiverCallNotAllowedException: BroadcastReceiver components are not allowed to register to receive intents
- 使用cocapods报错 [!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes
- Python编译提示:SyntaxError: Missing parentheses in call to 'print'
- webpack打包遇到locals[0] does not appear to be a `module` object with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using `env` section in Babel configuration
- Android N 通话界面_InCallActivity
- Introduction to using Java Persistence API in a web application in Java EE environment
- Using jQuery to directly call ASP.NET AJAX page methods
- Using CURL to download a remote file from a valid URL in c++