Example usage for android.content Context startService

List of usage examples for android.content Context startService

Introduction

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

Prototype

@Nullable
public abstract ComponentName startService(Intent service);

Source Link

Document

Request that a given application service be started.

Usage

From source file:at.ac.uniklu.mobile.sportal.notification.GCMUtils.java

public static void unregisterFromCampus(Context context, String regId) {
    context.startService(new Intent(context, GCMCampusService.class)
            .setAction(GCMCampusService.ACTION_UNREGISTER).putExtra(GCMCampusService.EXTRA_REGID, regId));
}

From source file:org.solovyev.android.messenger.OngoingNotificationService.java

static void startOngoingNotificationService(@Nonnull Context context) {
    final Intent serviceIntent = new Intent();
    serviceIntent.setClass(context, OngoingNotificationService.class);
    context.startService(serviceIntent);
}

From source file:net.zionsoft.obadiah.model.notification.PushNotificationRegister.java

public static void register(Context context) {
    if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(context) != ConnectionResult.SUCCESS) {
        return;/*from  w w  w . j  av a  2  s  .  c  om*/
    }

    context.startService(new Intent(context, PushNotificationRegister.class));
}

From source file:name.gudong.translate.listener.ListenClipboardService.java

public static void startForWeakLock(Context context, Intent intent) {
    Intent serviceIntent = new Intent(context, ListenClipboardService.class);
    context.startService(serviceIntent);

    intent.putExtra(ListenClipboardService.KEY_FOR_WEAK_LOCK, true);
    Intent myIntent = new Intent(context, ListenClipboardService.class);

    // using wake lock to start service
    WakefulBroadcastReceiver.startWakefulService(context, myIntent);
}

From source file:au.com.wallaceit.reddinator.MailCheckService.java

public static void checkMail(Context context, String action) {
    Intent intent = new Intent(context, MailCheckService.class);
    intent.setAction(action);/*from  ww w .  j av  a2  s.com*/
    context.startService(intent);
}

From source file:com.deltadna.android.sdk.notifications.DDNANotifications.java

/**
 * Register the client for push notifications.
 * <p>//from  ww  w  .  j av  a2  s  .  c o  m
 * A good time to perform this would be for example when the user enables
 * push notifications from the game's settings, or when a previous
 * registration attempt fails as notified by
 * {@link #ACTION_TOKEN_RETRIEVAL_FAILED}.
 * <p>
 * Method can be safely called from the Unity SDK, but local broadcasts
 * will not be sent.
 *
 * @see DDNA#setRegistrationId(String)
 */
public static void register(Context context) {
    Log.d(TAG, "Registering for push notifications");

    context.startService(new Intent(context, RegistrationIntentService.class));
}

From source file:com.llf.android.launcher3.MemoryTracker.java

public static void startTrackingMe(Context context, String name) {
    context.startService(new Intent(context, MemoryTracker.class).setAction(MemoryTracker.ACTION_START_TRACKING)
            .putExtra("pid", android.os.Process.myPid()).putExtra("name", name));
}

From source file:tv.acfun.a63.service.PushService.java

public static void start(Context context) {
    Intent service = new Intent(context, PushService.class);
    context.startService(service);
}

From source file:com.metinkale.prayerapp.MainIntentService.java

public static void startCalendarIntegration(Context context) {
    Intent intent = new Intent(context, MainIntentService.class);
    intent.setAction(ACTION_CALENDAR_INTEGRATION);
    context.startService(intent);
}

From source file:galilei.kelimekavanozu.AppService.java

public static void deletePoem(Context ctx, Integer id) {
    final Intent i = new Intent(ctx, AppService.class).putExtra(PARAM_OP, OP_DELETE_POEM)
            .putExtra(PoemContract.Columns.ID, id);
    ctx.startService(i);
}