1

I'm using a BroadcastReceiver to check for new data on the server every 5 minutes. I would like to set a kind of progress icon in my MainActivity's action bar every time a check is performed - how do I do that from the BroadcastReceiver?

Essentially I just want to use the setBackgroundResource() but I don't know how to do that from my BroadcastReceiver.

Edit: I'm starting the alarm in activity other than the activity I would like to update the progress bar and the BroadcastReceiver is in the separate class.

syntagma
  • 23,346
  • 16
  • 78
  • 134

1 Answers1

0

Check this: https://stackoverflow.com/a/9157874/3127335 You need to call setProgressBarIndeterminateVisibility(true); in onReceive(Context c, Intent i) method. You can use Intent and put extra boolean value and use it as setProgressBarIndeterminateVisibility argument. (You have to probably implement BroadcastReceiver in Activity).

Community
  • 1
  • 1