Questions tagged [localbroadcastmanager]

143 questions
1
vote
0 answers

Android LocalBroadcast manager onReceive not working

I tried to user localbroadcastreceivers in my android service class. But when ever it runs, the onReceive method in the main activity is not getting called. I have had look at several examples and tutorials, but couldn't find the problem. Main…
1
vote
0 answers

Can't send broadcast from worker thread to main thread

I am trying to implement an architecture similar to the one presented at the Android Developer Summit 2015: https://github.com/yigit/dev-summit-architecture-demo. My application has a simple class that handles the network requests. The class uses…
1
vote
1 answer

How to ensure any of application's Activities which is currently in foreground to receive a message

I want any of application's Activities which is currently in foreground to receive a message. So I'm sending a LocalBroadcastManager to distribute a message across my application. Then my idea was to have BaseActivity which all other Activities must…
1
vote
1 answer

Send LocalBroadcast if activity is running else send notification from a background service

I need to update my Activity from a background service using LocalBroadcast if the Activity is running. If the Application or Activity is not running at present, I would like to add a Pending Notification. I went through following posts - Check if…
pankaj
  • 1,316
  • 3
  • 16
  • 27
1
vote
1 answer

BroadcastReceiver's onReceive method is not called

I have an Activity with Fragment inside and IntentService. When I click button dialog fragment opens and I enter my data. After that I click Ok and it calls getActivity().startService(intent). Service calls sendBroadcast(intent) through…
1
vote
2 answers

Two Apps getting same notification message when i integrated my modules with that Apps

I am using android studio and i struck in implementing broadcast in my app so that it should trigger only one App and i'm using Localbroadcastmanager for registering and unregistering Android Phone APP1 APP2 My Modules I have…
1
vote
4 answers

IntentService LocalBroadcastManager not reaching Receiver

I'm using Android Studio 1.3, I have an IntentService setup that gathers some data and sends it out via a LocalBroadcastManager as so: IntentService public class cService extends IntentService { public cService(){ super("cService"); …
1
vote
1 answer

Can i register/unregister broadcast receiver in onCreateView/onDestroyView respectively?

I am broadcasting data (file download complete) from AsyncTask to Fragment and updating ListView accordingly. I have read that broadcast receiver should be registered/unregistered in onStart()/onStop() respectively. But in this case i will miss data…
1
vote
2 answers

Why LocalBroadcastManager is not working?

I tried to learn LocalBroadcastManager. Searched in web and implemented a simple app with Two activity to perform LocalBroadcastManager. But it's not working. I can't found what's wrong with my code. please help me! here is my…
khaleel_jageer
  • 1,404
  • 4
  • 16
  • 37
1
vote
3 answers

Android IntentService/Service to request/send data to web service and getting the progress to UI

On Android basically, I am trying to upload/download data from a web service and have a progress bar that should be rendered showing the progress percentage. Following is the approach that I implemented along with the reason for considering…
1
vote
2 answers

LocalBroadcastManager only with support library?

In my Android app I want to broadcast some notifications. In the MainActivity I register BroadcastReceiver which handles messages but as I understand it is not recommended to use global BroadcastReceiver if I do not want to send messages out of the…
1
vote
2 answers

Can LocalBroadcastManager detect WifiManager.NETWORK_STATE_CHANGED_ACTION changes?

I'd like to notify my Activity of any Wifi connection changes using the BroadcastReceiver. Since this broadcast is within the application I'm trying to use the more efficient LocalBroadcastManager object. However no matter what I do, the…
Nathan Liu
  • 2,135
  • 2
  • 14
  • 7
1
vote
2 answers

LocalBroadcastManager not working

I'm trying to sendMessage from service to activity, but for some reason it's not working. Activity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Jenya Kirmiza
  • 511
  • 8
  • 21
1
vote
2 answers

Can we use localbroadcast receiver to communicate between activity and service?

Hello I am working on android application where I want to use LocalBroadCastManager. I want to perform network operation in service and send result to activity from there using LocalBroadCastManager. Is it possible to do that using…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
1
vote
1 answer

Android - LocalBroadcastManager for SMS interception not firing

I've got an JavascriptInterface method that registers a LocalBroadcastManager listening to received SMS's. When an SMS arrives the onReceive method doesn't get called. public void UIregisterSMSSource(String number) { …
reixa
  • 6,903
  • 6
  • 49
  • 68