title: Send data from Activity to Service
body: <p>How can I send data from the current <code>Activity</code> to a background <code>Service</code> class which is running at certain time? I tried to set into <code>Intent.putExtras()</code> but I am not getting it in <code>Service</code> class</p>
  
  <p>Code in <code>Activity</code> class which calls the <code>Service</code>.</p>
  
  <pre><code>Intent mServiceIntent = new Intent(this, SchedulerEventService.class);
          mServiceIntent.putExtra("test", "Daily");
          startService(mServiceIntent);
  </code></pre>
  
  <p>Code in <code>Service</code> class. I treid to put in <code>onBind()</code> and <code>onStartCommand()</code>. None of these methods prints the value.</p>
  
  <pre><code>@Override
  public IBinder onBind(Intent intent) {
      //Toast.makeText(this, "service starting", Toast.LENGTH_SHORT).show();
  
      //String data = intent.getDataString();
  
      Toast.makeText(this, "Starting..", Toast.LENGTH_SHORT).show();
  
      Log.d(APP_TAG,intent.getExtras().getString("test"));
  
  
      return null;
  }
  </code></pre>