Tell us how would you update the UI of an activity from a background service?
Submitted by: MuhammadWe need to register a LocalBroadcastReceiver in the activity. And send a broadcast with the data using intents from the background service. As long as the activity is in the foreground, the UI will be updated from the background. Ensure to unregister the broadcast receiver in the onStop() method of the activity to avoid memory leaks. We can also register a Handler and pass data using Handlers.
Submitted by: Muhammad
Submitted by: Muhammad
Read Online Android Developer Job Interview Questions And Answers
Top Android Developer Questions
☺ | Explain me difference between Service & Intent Service? |
☺ | Tell us what is a BuildType in Gradle? And what can you use it for? |
☺ | Do you know the languages supported for Android development? |
☺ | Explain me what is a ContentProvider and what is it typically used for? |
☺ | Tell us why would you do the setContentView() in onCreate() of Activity class? |
Top Mobile Technologies Categories
☺ | Android Interview Questions. |
☺ | Wireless Communication Interview Questions. |
☺ | 3G Interview Questions. |
☺ | iPhone Interview Questions. |
☺ | Mobile App Architect Interview Questions. |