私はasynctaskに基づいて以下のコードブロックを持っています。 返り値LoadFeed()によってリスト変数を返そうとしています とdoInBackgroundの戻り値の型はStringです。私はその後、 の一覧を表示する文字列からdoInBackgroundの戻り値の型を変更する た場合、私はAndroid:リストを指定できません<String> AsyncTaskの戻り値の型:doInBackground
"The return type is incompatible with AsyncTask<String,Void,String>.doInBackground(String[])"
がどのように私はこのエラーを修正すればよいのエラーを取得しますか?
private class DispData extends AsyncTask<String, Void, String> {
private final ProgressDialog dialog = new ProgressDialog(MessageList.this);
// can use UI thread here
protected void onPreExecute() {
dialog.setMessage("Fetching scores...");
dialog.show();
}
// automatically done on worker thread (separate from UI thread)
protected String doInBackground(final String... args) {
return loadFeed();
}
// can use UI thread here
protected void onPostExecute(final List<String> result) {
if (dialog.isShowing()) {
dialog.dismiss();
}
adapter =
new ArrayAdapter<String>(MessageList.this,R.layout.row,result);
MessageList.this.setListAdapter(adapter);
}
}
チップをありがとう! – sammydude