0

单击按钮时接收器未注册。我究竟做错了什么?

private void  AppSatartConfirmationdialog() {
    AlertDialog.Builder bi=new AlertDialog.Builder(this);
    bi.setTitle(R.string.dialoga_pp_sart_conf_title);
    bi.setMessage(R.string.dialog_app_sart_conf_message);
    bi.setPositiveButton(R.string.dialog_app_sart_conf_oK, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            // TODO Auto-generated method stub
            //Caling receiver
            IntentFilter intentFilter = new IntentFilter("Intent.action.PHONE_STATE");
            registerReceiver(mReceiver, intentFilter);

            Toast.makeText(MainActivity.this,
            R.string.dialog_app_start_toast,
            Toast.LENGTH_SHORT).show();
        }
    });
4

0 回答 0