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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:27:12+00:00 2026-06-11T15:27:12+00:00

In my application I am using a simply way to send broadcast and receiver

  • 0

In my application I am using a simply way to send broadcast and receiver them.

Intent in = new Intent("UPDATE_SOMETHING");
sendBroadcast(in);

And in my receiver I just check if(intent.getAction().equals(“UPDATE_SOMETHING”)), of course in AndroidManifest in intent-filter i put so that the application know which receiver should receive it. This method works fine for me, and than i find out that this can be done i other way.

Intent in = new Intent(getApplicationContext(), Receiver.class);
in.setAction("UPDATE_SOMETHING");
sendBroadcast(in);

In this example i don’t need to put the action in AndroidManifest, and i can check it in the receiver in the same way as above (if(intent.get…))

Also there is a third way

Intent in = new Intent();
in.setAction("UPDATE_SOMETHING");
sendBroadcast(in);

And puting a action in AndroidManifest…

My question is, which of this three ways is the best to use?, and are there any differences between this ways? (except in writing the code) 🙂

  • 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-11T15:27:13+00:00Added an answer on June 11, 2026 at 3:27 pm

    First and third method are the same. The only difference how you pass actions to intent (through constructor or method). Both of these methods will send broadcast to all registered broadcast receivers who listens for UPDATE_SOMETHING action.

    In second method, you send broadcast explicitly to your Receiver class. So no other broadcast receiver will see/receive it.

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

Sidebar

Related Questions

I have a serial application that I parallelized using OpenMP. I simply added the
I have built a very simple blog application using Ruby on Rails. New to
i am writing an application using mongodb in which user can send messages to
I've got a legacy application that calls outlook using extended MAPI to send out
I'm using Xcode 4.3.2 to compile Cydia Applications. 4.1 has a simple way to
I was working on a small application using a simple binding in JavaFx 2.1
I have developed a simple application using SDK(Android: 3.2[API-13]) for, to display Google banners.
I am creating a simple application using the MVC design pattern where my model
I'm currently developing a simple iPhone application using a UITabBar and table views for
I am currently running a simple EJB application using a stateless Session Bean. I

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.