Questions tagged [localbroadcastmanager]

143 questions
0
votes
2 answers

My Activity not receiving Local Broadcasts sent from another activity

I'm just getting familiarised with the Local Broadcast Messages. I have 2 activities. MainActivity : I have 2 buttons. On the click of 1 button, I'm broadcasting the message. On the click of another one, I'm navigating to second Activity. public…
Rakesh
  • 1
  • 1
  • 3
0
votes
1 answer

Why LocalBroadcastManager of Android is not running?

I don't get what is wrong with this code. The Listener is in the onCreate of the activity: private BroadcastReceiver receiver; private Context context; @Override protected void onCreate(Bundle savedInstanceState) { …
andres83
  • 310
  • 1
  • 12
0
votes
1 answer

Sync "pause/resume" button's image with the actual state

In my Android app there is a Service performing long-running task (e.g. playing music) which can be in one of two states: running or paused. There is a single 'pause/resume' image button to pause/resume the task. And also the task can be paused…
Mikhail
  • 844
  • 8
  • 18
0
votes
2 answers

LocalBroadcastManager and possible security related issues

Here is how I am planning to do things: I have my Activity in which I register a BroadcastReceiver private LocalBroadcastManager localBroadcastManager; private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override …
0
votes
1 answer

Android: dynamically registering my receivers in a non-UI thread

I'm trying to optimise my android app and decided to transfer all my receivers which I register in the onStart method to a thread that is started within the onStart method instead. Here is the code: @Override public void onStart() { Timber.e(…
Simon
  • 19,658
  • 27
  • 149
  • 217
0
votes
2 answers

Use LocalBroadcastManager to send PendingResult reference (for ordered broadcasts)

I want to send a PendingResult via a LocalBroadcastManager since ordered broadcasts doesn't seem to be supported with LocalBroadcastManager. Can I make a wrapper object that implements Parcelable, which contains a memory reference to a PendingResult…
JohnyTex
  • 3,323
  • 5
  • 29
  • 52
0
votes
1 answer

LocalBroadcastManager broadcast not consumed

The Intents I broadcast with LocalBroadcastManager don't seem to be consumed, but instead accumulate. Each time I send a broadcast, I receive both it and all previously sent broadcasts, in onReceive. In a periodical JobService I'm creating a…
0
votes
1 answer

Android LocalBroadcastManager from Fragment to Activity not receiving message

I want to sent a message from a Fragment to an Activity (not the Fragment parent Activity, just another one). Actually I do the same from a Service to the same Activity and it works great. This is my code: Fragment: private void…
0
votes
0 answers

Android LocalBroadcastManger not always receive data

I have a fragment with TextView. From the different places of my app I want to update that TextView, so I'm using LocalBroadcastManager but it is not always working - In fact when I disable device administrator (this is MDM app) it 'forget' to…
Lau
  • 1,804
  • 1
  • 23
  • 49
0
votes
1 answer

Unable to send values from Local BroadcastManager to activity

Here i'm calling USSD code and then i'm trying to read that corresponding response by extending AccessibilityService. This process is working fine. But my problem is when i'm trying to transfer that corresponding data (or value) using LocalBroadCast…
0
votes
1 answer

Android - Are there serious performance issues with sending a localbroadcast every half second?

Are there serious performance issues with sending a localbroadcast every half second?
Andrew
  • 3,545
  • 4
  • 31
  • 37
0
votes
2 answers

Unable to update UI from IntentService

A seemingly simple requirement - to update UI from an IntentService. In the shot below, when the Start Service button is clicked, I need to show a ProgressBar above the only TextView and after a delay, remove the ProgressBar. Found a lot of answers…
0
votes
1 answer

BroadcastReceiver - Can't get button to change background

I have an Activity and a Service. In my Activity, a button interacts with the Service to start/stop GPS logging. My Service has 3 state indicators: One for being connected to Google Play Services, one for actively logging GPS, and one for processing…
Treeline
  • 475
  • 1
  • 8
  • 23
0
votes
2 answers

LocalBroadcast not working inside worker thread despite using Looper.getMainLooper()

I am trying to work on a screen(say Activity A) where there is a progress bar displayed on the screen and I need to send a broadcast to a different activity(Activity B) broadcastReceiver while the progressbar is running. And if the function in the…
0
votes
1 answer

Can a LocalBroadcastManager send Intent to global BroadcastReceivers in the same App?

Can a LocalBroadcastManager send an Intent to a globally registered BroadcastReceiver if it resides in the same App? Or do I have to use context.sendBroadcast() for that?
JohnyTex
  • 3,323
  • 5
  • 29
  • 52