Example usage for android.content Context sendBroadcast

List of usage examples for android.content Context sendBroadcast

Introduction

In this page you can find the example usage for android.content Context sendBroadcast.

Prototype

public abstract void sendBroadcast(@RequiresPermission Intent intent);

Source Link

Document

Broadcast the given intent to all interested BroadcastReceivers.

Usage

From source file:Main.java

public static void startNavi3D_amap(Context context) {
    Intent mIntent = new Intent("com.autonavi.minimap");
    mIntent.putExtra("NAVI", "MAP_3D_MODEL");
    context.sendBroadcast(mIntent);

}

From source file:Main.java

/**
 * Notifies UI to display a message./*from w  w w.ja  v a  2  s .co m*/
 * 
 * @param context
 *            - application's context
 * @param message
 *            - message to be displayed
 */
static void displayMessage(Context context, String message) {
    Intent intent = new Intent();
    intent.putExtra(EXTRA_MESSAGE, message);
    context.sendBroadcast(intent);
}

From source file:Main.java

/**
 * Sends a request to the Activity instance to process the messages.
 * /*  www . jav a  2s.c  o m*/
 * @param context The application context.
 */
public static void processMessages(Context context) {
    Log.i(TAG, "processMessages");
    Intent intent = new Intent(PROCESS_MESSAGES_ACTION);
    context.sendBroadcast(intent);
}

From source file:Main.java

public static void mediaScan(Context context, Uri uri) {
    Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
    intent.setData(uri);/*from  w  w w . ja  v  a  2  s  . co  m*/
    context.sendBroadcast(intent);
}

From source file:Main.java

/**
 * Sends a request to the Activity instance to process the messages.
 * //w  w  w. j a va2  s  .co  m
 * @param context The application context.
 */
public static void processMessages(Context context) {
    Log.i(TAG, "processMessages()");
    Intent intent = new Intent(PROCESS_MESSAGES_ACTION);
    context.sendBroadcast(intent);
}

From source file:Main.java

public static void startNaviNightMode_amap(Context context) {

    Intent mIntent = new Intent("com.autonavi.minimap");
    mIntent.putExtra("NAVI", "OPEN_NIGHT_MODEL");
    context.sendBroadcast(mIntent);

}

From source file:com.github.michalbednarski.intentslab.sandbox.SandboxManager.java

public static void resetSandbox(Context context) {
    context.sendBroadcast(new Intent().setClassName(SANDBOX_PACKAGE, RESET_RECEIVER_CLASS));
}

From source file:Main.java

public static void sendIntent(Context context, Uri uri) {
    Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
    intent.setData(uri);/*from w  ww .j a  v  a 2s  .  com*/
    context.sendBroadcast(intent);
}

From source file:Main.java

public static void closeNaviBroadcast_amap(Context context) {
    Intent mIntent = new Intent("com.autonavi.minimap");
    mIntent.putExtra("NAVI", "CLOSE_TRAFFIC_BROADCAST");
    context.sendBroadcast(mIntent);

}

From source file:Main.java

static void displayMessage(Context context, String message) {
    Intent intent = new Intent(DISPLAY_MESSAGE_ACTION);
    intent.putExtra(EXTRA_MESSAGE, message);
    context.sendBroadcast(intent);
}