getText()
will not return null
. So there is no chance for NPE in following method. the getText
will return empty string if there is no string, which is definitely not null
getText().toString();
However the edittext itself can be null
if not initialized properly, Hence the following will trigger NPE
editText.getText().toString();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…