Android Studio Tip #4 – Automatic Negation

Sometimes, (in fact, many times :P) you have to negate boolean expressions, and in order to do that, you write the expression and after that you go back to the beginning to add “!”, am I right? :D

Well, you can avoid doing this, by pressing the “!” instead of Enter when you use autocomplete. Just make sure the option from the autocomplete dialog is selected (it must be blue).

Negation

 

Scroll to Top