Caused by: java.lang.NullPointerException
at com.myapp.code.WordDescription.onRestart(WordDescription.java:685)
at android.app.Instrumentation.callActivityOnRestart(Instrumentation.java:1245)
at android.app.Activity.performRestart(Activity.java:3892)
at android.app.Activity.performResume(Activity.java:3911)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2424)
WordDescription.onRestartでエラーが発生し続ける理由がよくわかりません。多くの人がフォースクローズの問題について不平を言っています。これを修正する方法についての手がかりはありますか?ありがとう
これは関係があると思います。
public class MyArrayAdapter extends ArrayAdapter<String> {
private final Activity context;
private final String[] aListText;
private final String [] meaningText;
public MyArrayAdapter(Activity context, String[] wordText, String[] meaningText) {
super(context, R.layout.desclist2, wordText);
this.context=context;
this.aListText= wordText;
this.meaningText=meaningText;
}
} // .....
@Override
public void onRestart(){
super.onRestart();
clickFlag = false;
clickWordFlag = false;
myArrayAdapter.notifyDataSetChanged(); <-- line 685
}
Handler handler = new Handler(){ <-- line 709
@Override
public void handleMessage(Message msg){
progressDialog.dismiss();
if{ ....
}else{
myArrayAdapter = new MyArrayAdapter(WordDescription.this, wordArray, meaningArray);
listView.setAdapter(myArrayAdapter);
}
}