send Local Broadcast via Intent - Android android.content

Android examples for android.content:Intent

Description

send Local Broadcast via Intent

Demo Code

import android.content.Context;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;

public class Main {

  public static void sendLocalBroadcast(Context context, Intent intent) {
    if (context == null) {
      return;//from w  w  w .  j  a va 2 s  .c  om
    }

    LocalBroadcastManager manager = LocalBroadcastManager.getInstance(context);
    manager.sendBroadcast(intent);
  }

}

Related Tutorials