androidbroadcastreceiverandroid-support-librarylocalbroadcastmanager

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 app. Instead of this a LocalBroadcastManager or Handler should be used. In my case LocalBroadcastManager is more suitable but according to documentation it is part of a support library.

My app supports only Android 4 and 5 so I am not using support library. Is there a way how to use LocalBroadcastManager without support library? Thanks


Solution

  • My app supports only Android 4 and 5 so I am not using support library. Is there a way how to use LocalBroadcastManager without support library?

    No there is not. As the ViewPager and another small amounts of Widget/Classes, LocalBroadcastManager is part only of the support library