title: Background service with repeat time
body: <p>Hello i want to create a background service that will repeat at specific time each day to update the data from server, and until now i have this code:</p>
  
  <pre><code>public class Service_class extends Service {
  
  
  @Override
  public IBinder onBind(Intent arg0) {
      return null;
  }
  
  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
      Toast.makeText(this, "Service Started", Toast.LENGTH_LONG).show();
      return START_STICKY;
  }
  
  @Override
  public void onDestroy() {
  
      super.onDestroy();
      Toast.makeText(this, "Service Stopped", Toast.LENGTH_LONG).show();
  
  }
  
  @Override
  public void onCreate() {
      super.onCreate();
  }
  
  }
  </code></pre>
  
  <p>and i start the service with this code in main</p>
  
  <pre><code>startService(new Intent(getBaseContext(), Service_class.class));
  </code></pre>
  
  <p>How can i make this service repeat at exact time each day and never stop even if the app is closed? Thank you</p>