Created
July 17, 2016 22:59
-
-
Save catehstn/0e9faa4f079279a8bb7a149de5ffd0b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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