ModelFragment.javaで次の3つのエラーが発生します。
The method doInBackGround(Context...) of type ModelFragment.PrefsLoadTask must override or implement a supertype method
The type ModelFragment.PrefsLoadTask must implement the inherited abstract method AsyncTask<Context,Void,Void>.doInBackground(Context...)
Void methods cannot return a value
これが私のソースコードです:
private class PrefsLoadTask extends AsyncTask<Context, Void, Void> {
SharedPreferences localPrefs=null;
@Override
protected void doInBackGround(Context... ctxt) {
localPrefs=PreferenceManager.getDefaultSharedPreferences(ctxt[0]);
localPrefs.getAll();
return(null);
}
@Override
public void onPostExecute(Void Arg0) {
ModelFragment.this.prefs=localPrefs;
ModelFragment.this.prefsTask=null;
deliverModel();
}
}
私が見る限り、コードは本のようです。また、この章で入力したすべてのコードを確認しました。彼女に何か間違いがありますか?この章のステップ5の後、アプリは正常に実行されます。