Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package co.ortatech.showandhide.service;
import android.app.IntentService;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;
import javax.inject.Inject;
import co.ortatech.showandhide.application.ShowAndHideApplication;
public class ImageProcessingService extends IntentService {
@Inject ImageProcessingServiceHelper helper;
public ImageProcessingService() {
super(ImageProcessingService.class.getName());
}
public ImageProcessingService(String name) {
super(name);
}
@Override
public void onCreate() {
super.onCreate();
((ShowAndHideApplication) getApplication()).component().inject(this);
}
@Override
protected void onHandleIntent(Intent workIntent) {
Intent localIntent = helper.handleAndReturnAppropriateIntent(workIntent,
this.getContentResolver());
// If the action fails, the intent can be null.
if (localIntent != null) {
LocalBroadcastManager.getInstance(this).sendBroadcast(localIntent);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment