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 8094881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:56:14+00:00 2026-06-05T20:56:14+00:00

I have an ImageView in my activity that shows an active symbol when a

  • 0

I have an ImageView in my activity that shows an “active” symbol when a service is activated.
After the Service has been executed the ImageView should go back to the “inactive” Symbol.

AlarManager that starts Service:

    context = this;
    Intent intent = new Intent(context, AlarmReceiver.class);
            sender = PendingIntent.getBroadcast(context, INTENT_CODE, intent,
                    PendingIntent.FLAG_UPDATE_CURRENT);
            am = (AlarmManager) getSystemService(ALARM_SERVICE);
            am.set(AlarmManager.RTC_WAKEUP, calNew.getTimeInMillis(), sender);
setImage(active);

AlarmManager:

@Override
    public void onReceive(Context context, Intent intent) {

        Intent wakeupIntent = new Intent(context, WakeupActivity.class);
        context.startService(wakeupIntent);

    }

How can I make the Image change back to inactive after the service has been executed? I tried to create a new Runnable and then postDelayed(runnable, calNew.getTimeInMillis()) using a handler. Actually it didn’t work, nothing happened. Is there a better way to do this?

  • 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-05T20:56:16+00:00Added an answer on June 5, 2026 at 8:56 pm

    How can I make the Image change back to inactive after the service has been executed?

    Step #1: Add the Android Support package to your application.

    Step #2: Have your activity register a BroadcastReceiver with LocalBroadcastManager in onResume() and unregister it in onPause().

    Step #3: Have your service send a broadcast via LocalBroadcastManager when its work is complete, to be picked up by the activity’s BroadcastReceiver.

    Here is a sample project demonstrating this technique.

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

Sidebar

Related Questions

I have a ImageView which shows a picture that has been taken from the
I have an onClickListener that should call a class that shows and image from
I have imageView in activity. How I can set position this imageView in my
I have imageView inside a relative layout. And when i create the activity i
I have a LinearLayout and its child - ImageView. My activity's onCreate does nothing
I have a activity where I have two imagesViews. This to imagesViews has onClickListener,
In my view i have ImageView.If i click ,it should open nextview. Please help
I have a ImageView and draw some things on that view. Now I want
I have a very small activity that must show an image. If picture is
I have an Activity with a layout containing a custom ImageView and a few

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.