Cancel / call onPrepareOptionsMenu(...) callback. Change what you add, depending on the input status.
As an alternative, I have not tested this, but, in my opinion, it works: when creating menu items, store the handle of the input / output element in a class variable and simply update it by calling setTitle(...) if necessary.
Leffelmania
source share