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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:36:34+00:00 2026-06-08T22:36:34+00:00

I Have an app that is showing a toast when receiving broadcast and action

  • 0

I Have an app that is showing a toast when receiving broadcast and action equals BluetoothAdapter.ACTION_STATE_CHANGED, everything is working OK, but the problem here is that I want to do something when bluetooth is turning on but when bluetooth is activated from a button of the launcher it seems like the broadcast is arriving late or my app is receiving late or something like that, because when I started Bluetooth from other app, the receiver works great and on time.

Any suggestion in what is the problem? I have the receiver registered in manifest.

and it seems that sometimes loops infinitely because I have two toast to show when bluetoothAdapter.ACTION_STATE_CHANGED and it shows infinitely

Any idea of why is happening this and previous things?

Receiver:

public class Receivers extends BroadcastReceiver {

protected static AlertObject BTTurningOn = new AlertObject();

@Override
public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
    final String action = intent.getAction();


    this.context=context;


    if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
        final int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE,
                                             BluetoothAdapter.ERROR);




        if(state == BluetoothAdapter.STATE_TURNING_ON && BTTurningOn.Activated == true)
        {
            Alert(BTTurningOn);
        }






    }


}

BTTurningOn is just an object with some boolean variables to know whether to attend the broadcast message or not

Here is the important part of manifest:

<receiver android:name=".Receivers">
    <intent-filter>
        <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
</intent-filter>
</receiver>

When I start the bluetooth from my other app or from Adjusts/ wireless connections it works great, but its not working when I start it from an icon of the launcher or the upper bar where notifications appear, Im using GO Launcher EX Version 2.76

My other app get the broadcast and works great from the site that this app is not getting, but the difference is only where I register the receiver, this app is in MAnifest and other app is on one Activity

  • 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-08T22:36:37+00:00Added an answer on June 8, 2026 at 10:36 pm

    The answer is: I did not have the bluetooth permission in manifest, but it’s kinda strange because it did not receive broadcast messages when originated from Launcher but actually the app received them when originated from my other app

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

Sidebar

Related Questions

In my app I have a broadcast receiver that turns on GPS upon receiving
i have an app that is showing data in listview ,but i want first
have an app that finds your GPS location successfully, but I need to be
I have an app that uses a UINavigationController as its main way of showing
I have an app prototype that was working on Iphone4 + iOS 4.3, build
I have an iPad app that is not showing a table created programmatically. Where
I have a little app that downloads stock prices and was working perfectly (for
I have an App that has been working and selling in the App store
I have a console app that needs to display the state of items, but
i am working on an Android app that needs showing a list[table], inside the

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.