一切正常,直到我接听电话,然后几秒钟后,我收到一条“强制关闭”消息……知道出了什么问题吗?
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
PhoneStateListener imPhoneListener = new PhoneStateListener();
telephony.listen(imPhoneListener, PhoneStateListener.LISTEN_CALL_STATE);
Bundle bundle = intent.getExtras();
String phoneNr= bundle.getString("incoming_number");
Intent intent1=new Intent("android.intent.action.Checker");
intent1.putExtra("phoneNr", phoneNr);
context.startActivity(intent1);
}
哦,顺便说一句,即使应用程序在后台,我怎么能保证我的呼叫接收器总是首先工作?