Receiver 中的双重操作
Double actions in Receiver
我收到如下 2 个操作:
@Receiver (actions = MY_ACTION)
protected void myMethod(){
methodA();
}
@Receiver (actions = MY_ACTION_SECOND)
protected void myMethod(){
methodA();
}
是否可以在 1 个接收器中设置 2 个不同的 ACTION?
已更新
尝试:
@Receiver ({actions = MY_ACTION, actions = MY_ACTION_SECOND})
protected void myMethod(){
methodA();
}
@Receiver
接受一组动作:
@Receiver(actions = {MY_ACTION, MY_ACTION_SECOND})
void myMethod(){
// do something
}
我收到如下 2 个操作:
@Receiver (actions = MY_ACTION)
protected void myMethod(){
methodA();
}
@Receiver (actions = MY_ACTION_SECOND)
protected void myMethod(){
methodA();
}
是否可以在 1 个接收器中设置 2 个不同的 ACTION?
已更新
尝试:
@Receiver ({actions = MY_ACTION, actions = MY_ACTION_SECOND})
protected void myMethod(){
methodA();
}
@Receiver
接受一组动作:
@Receiver(actions = {MY_ACTION, MY_ACTION_SECOND})
void myMethod(){
// do something
}