When you create a Toast but do not call the show()
method Android Studio shows an tooltip saying: "Toast created but not shown: did you forget to call show()?" another example is not calling commit
or apply
when putting values into a SharedPreferencesEditor
object and a tooltip being displayed.
Is this just Android Studio being helpful or is there a way to define that after a method is called another method should be called?
This is just Intellij (Android Studio) being smart enough to figure through static code analysis.
There is no way to tell the compiler that after such method another method should run. The closest thing to it is writing unit tests and even that only notifies you during your test runs.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments