I am writing an Android client for consuming a SOAP based web service. I am using an AsyncTask
for performing the networking (that is calling the webservice) operation. I am in the middle of writing the client.
Now as I try to implement the
AsyncTask
'sdoInBackground
method, I get the following two errors atprotected String doInBackground(String[] params)...
if I write the@Override
annotation with it:The method doInBackground(String[]) of type MainActivity.MyTask must override or implement a supertype method. 1 Quick fix: Remove '@Override' annotation
and the following error at
private class MyTask extends AsyncTask...
:The type MainActivity.MyTask must implement the inherited abstract method AsyncTask.doInBackground(String[]...). 2 Quick fixes: Add unimplemented methods (this auto-generates the
doInBackground
method again with the@Override
annotation). Make type 'MyTask' abstract.if I don't write the
@Override
annotation, I get only the second error.... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String [] params = {URL, METHOD_NAME, NAMESPACE}; } private class MyTask extends AsyncTask<String[], Void, String> { //@Override write it or not write it? :s **************** protected String doInBackground(String[] params) { // TODO Auto-generated method stub return null; } } ...
What might be the reason behind this? What should I do?