Метод onReceive не вызывается

public class BroadcastTest extends Activity {
BroadcastReceiver receiver;

/** Called when the activity is first created. */

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    try{
    receiver=new Receiver(this);
    registerReceiver(receiver,new IntentFilter(Intent.ACTION_CALL_BUTTON));
    }catch(Exception e){
        Log.d("error",e.getMessage());
    }
  }
}

and another class

public class Receiver extends BroadcastReceiver{
public Receiver(BroadcastTest broadcastTest) {
    // TODO Auto-generated constructor stub
}

@Override
public void onReceive(Context arg0, Intent arg1) {
    // TODO Auto-generated method stub
    Log.d("Fired","Hi");
}
}

is onReceive method of receiver class supposed to be called when i press call button?if yes then it is not geting call.What i am doing wrong here.I am not seeing anything in logcat while pressing call button.Thanks in advance

5
задан Akshatha 18 May 2011 в 06:05
поделиться