Note that there are some explanatory texts on larger screens.

plurals
  1. POset notification alert
    primarykey
    data
    text
    <p>hi ia m new to android.. i have developed a programme to set notification onspecific time but the problem is it shows notification only of date before october 2011 if i enter any date of november its not showing any notification.. seems strange but really stuck here....</p> <p>main activity..</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Calendar cal = Calendar.getInstance(); // for using this you need to cal.set(Calendar.MONTH, 11); cal.set(Calendar.YEAR, 2011); cal.set(Calendar.DAY_OF_MONTH, 25); cal.set(Calendar.HOUR_OF_DAY, 18); cal.set(Calendar.MINUTE, 28); Intent alarmintent = new Intent(getApplicationContext(), AlarmReceiver.class); alarmintent.putExtra("title", "Title of our Notification"); alarmintent.putExtra("note", "Description of our Notification"); int HELLO_ID = 1; PendingIntent sender = PendingIntent.getBroadcast( getApplicationContext(), HELLO_ID, alarmintent, PendingIntent.FLAG_UPDATE_CURRENT | Intent.FILL_IN_DATA); AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE); am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), sender); } </code></pre> <p>and the alarm reciever activity...</p> <pre><code>public class AlarmReceiver extends BroadcastReceiver { private static final String NotificationManager = null; private static int NOTIFICATION_ID = 0; @Override public void onReceive(Context context, Intent intent) { (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); NotificationManager manger = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification(R.drawable.ic_launcher, "Combi Note", System.currentTimeMillis()); PendingIntent contentIntent = PendingIntent.getActivity(context, NOTIFICATION_ID, new Intent(context, AlarmReceiver.class), 0); Bundle extras = intent.getExtras(); String title = extras.getString("title"); String note = extras.getString("note"); notification.setLatestEventInfo(context, note, title, contentIntent); notification.flags = Notification.FLAG_INSISTENT; notification.defaults |= Notification.DEFAULT_SOUND; manger.notify(NOTIFICATION_ID, notification); } }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload