android.app.IntentService Java Examples

The following examples show how to use android.app.IntentService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MemoryServiceWriter.java    From Android-Developer-Toolbelt with Apache License 2.0 6 votes vote down vote up
@Override
public void writeSource(Writer writer) throws IOException {

    TypeSpec typeSpec = TypeSpec.classBuilder(getSimpleName())
            .superclass(ClassName.get(IntentService.class))
            .addModifiers(Modifier.PUBLIC, Modifier.FINAL)
            .addField(createFieldMessenger())
            .addField(createFieldAllocations())
            .addField(createFieldRun())
            .addMethod(createConstructor())
            .addMethod(createOnBind())
            .addMethod(createOnHandleIntent())
            .build();

    JavaFile javaFile = JavaFile.builder(PACKAGE, typeSpec)
            .addFileComment("Generated by MemoryServiceWriter.java. Do not modify!")
            .build();

    javaFile.writeTo(writer);
}
 
Example #2
Source File: ScheduledJobService.java    From android-sdk with Apache License 2.0 4 votes vote down vote up
private void callOnHandleIntent(IntentService intentService, Intent intent) {
    callMethod(IntentService.class, intentService, "onHandleIntent", new Class[] { Intent.class }, intent);
}
 
Example #3
Source File: JobWorkService.java    From android-sdk with Apache License 2.0 4 votes vote down vote up
private void callOnHandleIntent(IntentService intentService, Intent intent) {
    callMethod(IntentService.class, intentService, "onHandleIntent", new Class[] { Intent.class }, intent);
}