I\'m getting a NetworkOnMainThreadException in my Service class, which by nature doesn\'t make sense, because Services are background processes as
NetworkOnMainThreadException
Service
i just resolve this problem by using this :
public int onStartCommand(Intent intent, int flags, int startId) { RefreshDBAsync task = new RefreshDBAsync(this); task.execute(); return START_STICKY; }
RefreshDBAsync is making request to a server at every 5 minutes