Android Studio helps the user writing good code in several ways. One of them is the Code Inspection which tells the user about some missing stuff or unused code. For example, when I have an Activity with a Fragment in it, i use FragmentTransactions to change the Fragment. To finish such a transaction, I have to call commit()
. If I don't do this, Android Studio gives me this warning:
If you use a Toast and forget to call show()
on it, there is a similar warning.
So my question is: Can I implement a custom inspection like this?
As Android Studio is based on the IntelliJ IDEA, this is probably a feature of IntelliJ.