Câu hỏi phỏng vấn Android
Câu hỏi

What is a LocalBroadcastManager ?

Câu trả lời

LocalBroadcastManager is a utility class in Android that allows you to send and receive broadcasts within your own application, without the overhead and security concerns of global broadcasts[1][2][3]. It provides a simple way to communicate between different components of your app, such as activities, services, and fragments[1][3].

Here are the key points about LocalBroadcastManager:

  • It is more efficient than using global broadcasts because the broadcasts are limited to your own application[2][3].
  • It ensures that the broadcast cannot be received by any components outside your application, preventing potential leaks of private or sensitive data[2][3].
  • Other applications cannot transmit broadcasts to your receivers, reducing the risk of security exploits[2].
  • To use it, you need to include the Android Support Library in your application[2][3].
  • You register a receiver in your activity or service's li...
middle

middle

Gợi ý câu hỏi phỏng vấn

junior

Explain the build process in Android

senior

What is a Sticky Broadcast ?

middle

What is the difference between onCreate() and onCreateView() lifecycle methods in Fragment ?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào