I know that a Intent Service ends as soon as it's work is complete. I am making network calls on onHandleIntent().The service dies as soon as it starts but the network calls complete successfully.
Is it because all the methods for network calls are called and they exist in a different thread? So, the service dies?
@Override
protected void onHandleIntent(@Nullable Intent intent) {
Log.i(TAG, "Download Service Started!");
initVariables();
startDownloadService(intent);
}
private void startDownloadService(Intent intent) {
receiver = intent.getParcelableExtra("receiver");
notifyDownloadRunning("Trying to start Download");
getNews();
getVideoDetails();
.................
}
Retorfit Interface
@GET()
Observable<VideoDetailsRoot> getVideoDetails(@Url String url);