I am trying to create an AsyncTask that will allow me to download content from a webpage in the background. This is what I have found to do in my research: { private class myTask extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
}
@Override
protected Void doInBackground(Void... params) {
// Runs on the background thread
return null;
}
@Override
protected void onPostExecute(Void res) {
}
}
I tried to create a new Android class and replace the contents with this but it is saying that 'extends' is invalid in the current context. Do I need to include any references to get this to work and if so how do I get them?