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

  • SEARCH
  • Home
  • 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 8223231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:36:59+00:00 2026-06-07T14:36:59+00:00

I develop an app that shows date in status bar as icon(an image for

  • 0

I develop an app that shows date in status bar as icon(an image for every day,1,2,3,…),now my problem is that when the date change i can’t sense it.
is there any way that can catch the change of date and update the status bar icon.

    mNM  =(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    int resId = getResources().getIdentifier("p_"+Day_Num, "drawable", getPackageName());
    Notification notification = new Notification(resId, "", System.currentTimeMillis());
    RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_notification);
    contentView.setImageViewResource(R.id.image, resId);
    contentView.setTextViewText(R.id.title, Day);
    contentView.setTextViewText(R.id.text, Date);
    contentView.setOnClickPendingIntent(R.id.imageView1, PendingIntent.getActivity(this, 0, new Intent(this, Option.class),0));
    notification.contentView = contentView;
    Intent notificationIntent = new Intent(this, Option.class);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
    notification.contentIntent = contentIntent;
    notification.defaults = Notification.FLAG_NO_CLEAR;
    mNM.notify(NOTIFICATION, notification);

when I use servic Calservice.java:

 public void onCreate() {
      //code to execute when the service is first created
       alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
        Intent intent = new Intent(ALARM_REFRESH_ACTION);
        pendingIntent = PendingIntent.getBroadcast(this, 0, intent,
                PendingIntent.FLAG_CANCEL_CURRENT);
        alarmReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                alarmCounted++;
                Message msg = myHandler.obtainMessage(ALARM_CODE, intent);
                myHandler.sendMessage(msg);
            }
        };
        IntentFilter filter = new IntentFilter(ALARM_REFRESH_ACTION);
        registerReceiver(alarmReceiver, filter);
        mNM  =(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        utils.getCurrentShamsidate();
        startRepeating();
   }

       public void startRepeating() {
        // We get value for repeating alarm
        int startTime =1000;
        long intervals =1000;
        // We have to register to AlarmManager
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        calendar.add(Calendar.MILLISECOND, startTime);
        // We set a repeating alarm
        alarmManager.setRepeating(AlarmManager.RTC, calendar
                .getTimeInMillis(), intervals, pendingIntent);
    }
            private void showNotification() {

    mNM.cancelAll();
    utils.getCurrentShamsidate();
    int resId = getResources().getIdentifier("p_"+Day_Num, "drawable", getPackageName());
    Notification notification = new Notification(resId, "", System.currentTimeMillis());
    RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_notification);
    contentView.setImageViewResource(R.id.image, resId);
    contentView.setTextViewText(R.id.title, Day);
    contentView.setTextViewText(R.id.text, Date);
    contentView.setOnClickPendingIntent(R.id.imageView1, PendingIntent.getActivity(this, 0, new Intent(this, Option.class),0));
    notification.contentView = contentView;
    Intent notificationIntent = new Intent(this, Option.class);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
    notification.contentIntent = contentIntent;
    mNM.notify(NOTIFICATION, notification);
  }
    public void doscan() {
            String Day = Day_Num;
            utils.getCurrentShamsidate();
            if(!Day_Num.equals(Day))
                showNotification();
        }
  • 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-06-07T14:37:02+00:00Added an answer on June 7, 2026 at 2:37 pm

    @hamhame, Why don’t you try an AlarmManager, to set alarm on Every morning at 12:00 Am. in this way you can set your opration and do things pretty easily..

    This link can help you more on how to set a repeating alarm for Time interval of 24 hours.

    for listening to TIme/Date change by user see this answer.

    you need to register a receiver(with required action given in above link) via manifest (if want to listen always ) or register in Activity/service according to your need. and in receiver you will got to know what time has been set by getting current time and can modify you AlarmReceiver too.

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

Sidebar

Related Questions

I want to develop an android app that uses image recognition technology similar to
I am looking to develop a web-app that displays an image to the user
I want to develop an app in php that I can link with a
I've noticed something that happens in every app i develop. It's usually not a
I need to develop an app that runs side by side with a django-app.
I'm trying to develop an app that would normally be considered to be malware,
I was wondering what technologies are needed to develop and app that uses different
I am attempting to develop an Android app that allows a user to write
I want to develop an enterprise app that includes a WindowsForms presentation layer, middle-tier
I need to develop an android app that achieves the following: Create an activity

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.