title: titanium appcelerator android daily notification at some specified time
body: <p>I am creating a native android app using Titanium Appcelerator which shows notification daily at some specified time (say 8.00 a.m).In <em>app.js</em> the android service is called.</p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var intent = Ti.Android.createServiceIntent({
  url : 'MyService.js'
  });
  intent.putExtra('interval', new Date().getTime());
  Ti.Android.startService(intent);
  </code></pre>
  
  <p><strong>MyService.js</strong></p>
  
  <pre><code>var activity = Ti.Android.currentActivity();
  var intent = Ti.Android.createIntent({
  action : Ti.Android.ACTION_MAIN,
  url : 'app.js',
  flags : Ti.Android.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Ti.Android.FLAG_ACTIVITY_SINGLE_TOP
  });
  intent.addCategory(Titanium.Android.CATEGORY_LAUNCHER);
  var pending = Ti.Android.createPendingIntent({
  activity : activity,
  intent : intent,
  type : Ti.Android.PENDING_INTENT_FOR_ACTIVITY,
  flags : Ti.Android.FLAG_ACTIVITY_NO_HISTORY
  });
  var notification = Ti.Android.createNotification({
  contentIntent : pending,
  contentTitle : 'Main Notification',
  contentText : 'Whats Today',
  tickerText : 'This is main notification',
  when : "08:00",
  icon : Ti.App.Android.R.drawable.appicon,
  flags : Titanium.Android.ACTION_DEFAULT | Titanium.Android.FLAG_AUTO_CANCEL | Titanium.Android.FLAG_SHOW_LIGHTS
  });
  Ti.Android.NotificationManager.notify(1, notification);
  var service = Ti.Android.currentService;
  var serviceIntent = service.getIntent();
  </code></pre>
  
  <p><em>and my tiapp.xml is</em></p>
  
  <pre><code>&lt;android xmlns:android="http://schemas.android.com/apk/res/android"&gt;
     &lt;!-- the activities tag must be added if you want to use the url property to launch your app --&gt;
     &lt;activities&gt;
         &lt;activity url="app.js"&gt;
             &lt;intent-filter&gt;
                 &lt;action android:name="android.intent.action.VIEW"/&gt;
                 &lt;category android:name="android.intent.category.DEFAULT"/&gt;
                 &lt;category android:name="android.intent.category.BROWSABLE"/&gt;
             &lt;/intent-filter&gt;
         &lt;/activity&gt;
     &lt;/activities&gt;
     &lt;!-- the services tag must be added so that our service will run --&gt;
     &lt;services&gt;
         &lt;service type="interval" url="MyService.js"/&gt;
     &lt;/services&gt;
  &lt;/android&gt;
  </code></pre>
  
  <p><strong>But this creates notification when application starts and I am unable to create notification daily at 8.00 am. Any possible workarounds?</strong></p>