title: How i call IntentService from Broadcast Receiver?
body: <p>I make an intent service for download data and i want to repeat with broadcast receive and alarm manager.How i call my intent service?I try this but no work....</p>
  
  <pre><code>public class MyBroadcastReceiver extends BroadcastReceiver {
  
  
      @Override
  
        public void onReceive(Context context, Intent intent) {
  
            Toast.makeText(context, "Don't panik but your time is up!!!!.",
              Toast.LENGTH_LONG).show();
          // Vibrate the mobile phone
          Vibrator vibrator = (Vibrator)   
  context.getSystemService(Context.VIBRATOR_SERVICE);
          vibrator.vibrate(500);
  
          intent.setData(Uri.parse("http://www.mysite.net/LEDstate.txt"));
          intent.putExtra("urlpath", "http://www.mysite.net/LEDstate.txt");
          //startService(intent);
  
          context.startService(new Intent(context, DownloadService.class));
  
          }
  </code></pre>
  
  <p>public class AlarmActivity extends Activity {</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  }
  
  public void startAlert(View view) {
  
      EditText text = (EditText) findViewById(R.id.time);
  
      int i = Integer.parseInt(text.getText().toString());
  
      Intent intent = new Intent(this, MyBroadcastReceiver.class);
  
      PendingIntent pendingIntent = PendingIntent.getBroadcast(this.getApplicationContext(), 234324243, intent, 0);
  
      AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
  
      //alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()
         // + (i * 1000),pendingIntent);
  
      alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()
                   ,(i*1000),pendingIntent);
  
     // alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar
      //      .getTimeInMillis(), intervals, pendingIntent);
  
  
      Toast.makeText(this, "Alarm set in " + i + " seconds",
          Toast.LENGTH_LONG).show();
    }
  </code></pre>