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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:51:12+00:00 2026-05-30T18:51:12+00:00

I’m a starter in Android app development, and my experience in Java development is

  • 0

I’m a starter in Android app development, and my experience in Java development is also minimal.

I’m working on a very basic context-aware application and I want to understand how can I notify my activity class of some custom event? (unlike onClick()). So if I have a class which is responsible for monitoring some resource. (For simplicity, let’s assume a Timer class which monitors time and notifies the Activity class every hour).

How can my activity class ‘subscribe’ and listen for such events from the Timer class?

I would really appreciate if you provide some code example and perhaps how event handling works in Android/Java. Thanks for your time and help!

  • 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-30T18:51:14+00:00Added an answer on May 30, 2026 at 6:51 pm

    Use Broadcast Intents to notify listeners of system or application/custom events..

    send a Broadcast using sendBroadcast method whenever your custom event occurs..

    Intent intent = new Intent(NEW_Intent);
    intent.putExtra(“Test”,Test1);
    sendBroadcast(intent);
    

    To create a new Broadcast Receiver(which will listen to your event/broadcast), extend the BroadcastReceiver class and override the onReceive event handler.The onReceive method will be executed when a Broadcast Intent is received that matches the Intent Filter used to register the receiver.

    Register your receiver in either Manifest file or in the code..

    //in xml

    <receiver android:name=”.ReceiverName”>
    <intent-filter>
    <action android:name=”com.paad.action.NEW_INTENT”/>
    </intent-filter>
    </receiver>
    

    //in code..

    IntentFilter filter = new IntentFilter(NEW_INTENT);
    ReceiverName r = new ReceiverName();
    registerReceiver(r, filter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.