Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6850091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:04:52+00:00 2026-05-27T01:04:52+00:00

hi ia m new to android.. i have developed a programme to set notification

  • 0

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….

main activity..

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);
}

and the alarm reciever activity…

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);

    }
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:04:53+00:00Added an answer on May 27, 2026 at 1:04 am

    You are setting an alarm for 5/5/2011, this date has passed so it is executed immediately.

    When you receive a instance of Calendar, I think that the system automatically fills in the current date & time. So change only what you need to change (I.E if you want to send a notification in 5 days, change the day only in the calendar instance)

    By the way, when clicking the notification it will, again, call your BroadcastReceiver and this time the intent won’t have the extras you have put in it while in the activity. When clicking the notification, you should launch an activity – not a broadcast receiver.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, im fairly new to android but i have managed to teach myself the
I'm developing an android app, and have developed a game, but I now have
i'm new at Android world, and i have a doubt, is there any method
I am completely new to android, and pretty much a Java newb. I have
I have to admit that I'm new to Java and Android. db4o seems to
I have this code on my Android phone. URI uri = new URI(url); HttpPost
I have developed an application in android and also deployed in the mobile. While
I have developed some reusable android component which is basically a class . This
I need help in upgrading apk file. I have apk file developed for android
Hi there Im new to mobile application development. I had developed Android apps using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.