在模拟器上能间听到接收短信的广播,在手机上却收不到,为什么?

解决方案 »

  1.   

    在接收广播的内部类里有log,但没有打印
      

  2.   


    /**
     * 注册广播
     */
    private void registerBroadcast(){
    registerReceiver(mCommandReceiver, new IntentFilter(SMS_RECEIVED));
    }

    /**
     * 接收广播内部类
     */
    private class CommandReceiver extends BroadcastReceiver { @Override
    public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    Toast.makeText(SMSService.this, action, Toast.LENGTH_LONG).show();
    }
    }
      

  3.   

    是不是,没有权限。
    难道没有任何错误信息,log呢?
      

  4.   

    没报任何错,在模拟器里可以收到所以权限是有的,我手机是moto MB525  android2.2.1系统