Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;
import android.content.Intent;

import android.util.Log;

public class Main {
    private static final String TAG = "BroadcastHelper";

    public static void sendBroadcast(String filter, Context context) {
        Intent startupIntent = new Intent(filter);

        try {
            context.sendBroadcast(startupIntent);
        } catch (NullPointerException ex) {
            Log.e(TAG, "Intent broadcast failed. Error: " + ex.toString());
        }
    }
}