Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
アクティビティのログインページにエラーメッセージを表示するTextViewがあります。このアクティビティに戻ったときに、その値をクリアする方法がわかりません。editText.setText("")EditTextフィールドに使用しました。しかし、これをTextViewに使用しようとすると、NullPointerException ここで何を使用できるかが表示されました。
editText.setText("")
NullPointerException
error = (TextView) findViewById(R.id.errorPopUp);
メソッドでonResume():
onResume()
@Override protected void onResume() { super.onResume(); error.setText(""); }
このアクティビティのライフサイクルを確認する必要があります