I´m a student learning how to crate an android app. currently i´m learning about ServiceIntents. Following my transcript: to test the upload funcionality of a button, i have to use the UploadIntentService
-class. But if i write the code exactly how it´s shown in my transcript Android Studio already highlight UploadIntentService
in red.
Here´s the code from the transcript (MainActivity.java
):
public void onClickUpload (View button){
Intent uploadIntent = new Intent(this, UploadIntentService.class);
startService(uploadIntent);
}
protected void onHandleIntent(Intent intent){
Log.v(UploadIntentService.class.getSimpleName(), "Service sleeping...");
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Log.v(UploadIntentService.class.getSimpleName(), "Service wake up...");
}
Imports:
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.app.IntentService;
If i try to run the app the build process can´t be done:
cannot find symbol class UploadIntentService
cannot find symbol class UploadIntentService
cannot find symbol class UploadIntentService
uses or overrides a deprecated API.
I´m working with java, not Kotlin.