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:com.doctoror.surprise.SurpriseService.java

public static void upgradeSurprise(final Context context) {
    final Intent intent = new Intent(context, SurpriseService.class);
    intent.setAction(ACTION_UPGRADE_SURPRISE);
    context.startService(intent);
}

From source file:com.github.kimikage.uguisuan.WavePlayerService.java

public static void update(int status) {
    Context context = UguisuAnne.getContext();
    Intent intent = new Intent(context, WavePlayerService.class);
    intent.putExtra(ARG_ACTION, Receiver.ACTION_UPDATE);
    intent.putExtra(ARG_STATUS, status);
    context.startService(intent);
}

From source file:com.doctoror.fuckoffmusicplayer.presentation.media.MediaManagerService.java

public static void deleteMedia(@NonNull final Context context, final long id) {
    final Intent intent = new Intent(context, MediaManagerService.class);
    intent.setAction(ACTION_MEDIA_DELETE);
    intent.putExtra(EXTRA_TARGET_ID, id);
    context.startService(intent);
}

From source file:org.qeo.deviceregistration.service.RegisterService.java

/**
 * This will put your device in headless registration mode. Another device can now register you.<br>
 * If this happens, {@link #ACTION_HEADLESS_REGISTRATION_DONE} will be broadcasted. You must register a receiver
 * for this action or nothing will happen.
 * @param ctx The android context./*from  w w  w  .  j a  va2 s.com*/
 */
public static void startHeadlessRegistration(Context ctx) {
    Intent headlessService = new Intent(ctx, HeadlessRegistrationQeoService.class);
    ctx.startService(headlessService);
}

From source file:com.doctoror.fuckoffmusicplayer.presentation.media.MediaManagerService.java

public static void deleteAlbum(@NonNull final Context context, final long albumId) {
    final Intent intent = new Intent(context, MediaManagerService.class);
    intent.setAction(ACTION_ALBUM_DELETE);
    intent.putExtra(EXTRA_TARGET_ID, albumId);
    context.startService(intent);
}

From source file:com.jaspersoft.android.jaspermobile.activities.save.SaveReportService.java

public static void cancel(Context context, Uri reportUri) {
    Intent cancelIntent = SaveReportService_.intent(context).get();
    cancelIntent.setAction(ACTION_CANCEL_SAVING);
    cancelIntent.putExtra(ITEM_URI_EXTRA, reportUri);
    context.startService(cancelIntent);
}

From source file:com.jaspersoft.android.jaspermobile.activities.save.SaveReportService.java

public static void start(Context context, ExportBundle bundle) {
    Intent startIntent = SaveReportService_.intent(context).get();
    startIntent.setAction(ACTION_SAVE_REPORT);
    startIntent.putExtra(EXPORT_BUNDLE_EXTRA, bundle);
    context.startService(startIntent);
}

From source file:com.doctoror.fuckoffmusicplayer.presentation.media.MediaManagerService.java

public static void deletePlaylist(@NonNull final Context context, final long playlistId) {
    final Intent intent = new Intent(context, MediaManagerService.class);
    intent.setAction(ACTION_PLAYLIST_DELETE);
    intent.putExtra(EXTRA_TARGET_ID, playlistId);
    context.startService(intent);
}

From source file:com.commonsware.android.tte.DocumentStorageService.java

public static void loadDocument(Context ctxt, Uri document) {
    Intent i = new Intent(ctxt, DocumentStorageService.class).setAction(Intent.ACTION_OPEN_DOCUMENT)
            .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION).setData(document);

    ctxt.startService(i);
}

From source file:com.nononsenseapps.feeder.model.RssSyncHelper.java

/**
 * Starts this service to perform action Foo with the given parameters. If
 * the service is already performing a task this action will be queued.
 *
 * @see IntentService//from   w  w w .  j a va 2 s.  co m
 */
public static void syncFeeds(Context context) {
    Intent intent = new Intent(context, RssSyncHelper.class);
    context.startService(intent);
}