あるクラスからアクティビティクラスにメソッドを呼び出そうとしましたが、edittextでnullpointer例外が発生しました。
//これはメソッドクラスで作成したメソッドです
public void getEditTextValue(EditText edittext, int resources, String DataValue , String vEditTextValue) {
methods md = new methods();
edittext = (EditText) findViewById(resources);
vEditTextValue = edittext.getText().toString();
md.editorSharePreferences(this, DataValue, vEditTextValue);
}
//メインアクティビティクラスでこのメソッドを呼び出し、クラスの先頭でpublicEditTextedittextを宣言します
public EditText edittext;
methods md = new methods();
md.getEditTextValue(currentEmployerMonth, R.id.etTimeWithYourCurrentEmployerMonths, "dCurrentEmployerMonth", vCurrentEmployerMonth);