Note: This is intended as a canonical question for a commonly seen problem here on Stack Overflow.
My Android app crashed. I checked the stacktrace from the logcat and found that the cause is a NullPointerException
at the line
myEditText.setText(myString);
What is the problem and how do I fix it?