title: Android: Unable to specify List<String> return type for AsyncTask:doInBackground
body: <p>I have the following block of code based on an asynctask.
  I'm trying to return a List variable via return LoadFeed()
  and the return type of doInBackground is String.
  If I change the return type of doInBackground from String to List
  then I get an error</p>
  
  <pre><code>"The return type is incompatible with AsyncTask&lt;String,Void,String&gt;.doInBackground(String[])"
  </code></pre>
  
  <p>How do I fix this error?
  Please help</p>
  
  <p>Thanks,</p>
  
  <pre><code>  private class DispData extends AsyncTask&lt;String, Void, String&gt; {
     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&lt;String&gt; result) {
        if (dialog.isShowing()) {
           dialog.dismiss();
        }
       adapter = 
              new ArrayAdapter&lt;String&gt;(MessageList.this,R.layout.row,result);
       MessageList.this.setListAdapter(adapter);
  
     }
  }
  </code></pre>