Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve symbol 'AsyncTask' in Android Studio

I have a class which extends AsyncTask in Java, but Android Studio gives an error that the symbol AsyncTask can't be resolved.

class GcmRegistrationAsyncTask extends AsyncTask<Void, Void, String> {
// CLASS CODE
}

Do I miss an import statement or is my code wrong?

like image 441
user2274356 Avatar asked Feb 09 '23 23:02

user2274356


1 Answers

I have the same issue in my Android Studio installation. Auto organizing does not work, but if you manually add import android.os.AsyncTask; to your imports, the class will be found.

like image 121
Florian Avatar answered Feb 15 '23 09:02

Florian