利用广播监听 手机拨号 在虚拟机上能运行 真机没法应
求助 利用广播监听 手机拨号 在虚拟机上能运行 真机没法应
部分代码 如下 求大神 解答
public class OutgoingCallReceiver extends BroadcastReceiver { @SuppressLint("ShowToast") @Override public void onReceive(Context context, Intent intent) { String phone = this.getResultData();//得到外拔电话 System.out.println("拨号"+phone); Toast.makeText(context, "正在拨号"+phone, 10000).show(); } }
<!-- 去电广播接收者 --> <receiver android:name=".OutgoingCallReceiver" > <intent-filter> <!-- 监听去电 --> <action android:name="android.intent.action.NEW_OUTGOING_CALL" /> <action android:name="android.intent.action.BOOT_COMPLETED"/> </intent-filter> </receiver>
本人QQ 850459198 求大神帮忙看下 什么原因 虚拟机运行能 监听到 拨号 真机运行玩全没反应 魅蓝note 已测试