launch Intent Broadcast - Android Intent

Android examples for Intent:Broadcast

Description

launch Intent Broadcast

Demo Code


//package com.java2s;
import android.content.Context;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;

public class Main {
    public static void launchBroadcast(Context context, String intentType,
            String messageType, String message) {
        Intent intent = new Intent(intentType);
        intent.putExtra(messageType, message);
        LocalBroadcastManager broadcaster = LocalBroadcastManager
                .getInstance(context);//from   w w w .  j a  va2 s  .c  o m
        broadcaster.sendBroadcast(intent);
    }
}

Related Tutorials