Tabnine Logo
ListenableWorker$Result.success
Code IndexAdd Tabnine to your IDE (free)

How to use
success
method
in
androidx.work.ListenableWorker$Result

Best Java code snippets using androidx.work.ListenableWorker$Result.success (Showing top 14 results out of 315)

origin: westnordost/StreetComplete

  @NonNull @Override public Result doWork()
  {
    try
    {
      osmQuestChangesUpload.closeOpenChangesets();
    }
    catch(OsmConnectionException e)
    {
      // wasn't able to connect to the server (i.e. connection timeout). Oh well, then,
      // never mind. Could also retry later with Result.retry() but the OSM API closes open
      // changesets after 1 hour anyway.
    }
    catch(OsmAuthorizationException e)
    {
      // the user may not be authorized yet (or not be authorized anymore) #283
      // nothing we can do about here. He will have to reauthenticate when he next opens the app
      return Result.failure();
    }
    return Result.success();
  }
}
origin: rsiebert/TVHClient

  @NonNull
  @Override
  public Result doWork() {
    Timber.d("Loading more event data from server");

    Intent intent = new Intent();
    intent.setAction("getMoreEvents");
    intent.putExtra("numFollowing", 250);
    EpgSyncIntentService.enqueueWork(getApplicationContext(), intent);
    return Result.success();
  }
}
origin: googlecodelabs/android-workmanager

  return Result.success();
} catch (Exception exception) {
  Log.e(TAG, "Error cleaning up", exception);
origin: googlecodelabs/android-workmanager

  return Result.success(outputData);
} catch (FileNotFoundException fileNotFoundException) {
  Log.e(TAG, "Failed to decode input stream", fileNotFoundException);
origin: googlecodelabs/android-workmanager

      .putString(Constants.KEY_IMAGE_URI, imageUrl)
      .build();
  return Result.success(outputData);
} catch (Exception exception) {
  Log.e(TAG, "Unable to save image to Gallery", exception);
origin: commonsguy/cw-androidarch

return ListenableWorker.Result.success(new Data.Builder()
 .putString(UnZIPWorker.KEY_ZIPFILE, downloadedFile.getAbsolutePath())
 .build());
origin: commonsguy/cw-androidarch

 @NonNull
 @Override
 public Result doWork() {
  OkHttpClient client=new OkHttpClient();
  Request request=new Request.Builder()
   .url(getInputData().getString(KEY_URL))
   .build();

  try (Response response=client.newCall(request).execute()) {
   File dir=getApplicationContext().getCacheDir();
   File downloadedFile=
    new File(dir, getInputData().getString(KEY_FILENAME));
   BufferedSink sink=Okio.buffer(Okio.sink(downloadedFile));

   sink.writeAll(response.body().source());
   sink.close();
  }
  catch (IOException e) {
   Log.e(getClass().getSimpleName(), "Exception downloading file", e);

   return ListenableWorker.Result.failure();
  }

  return ListenableWorker.Result.success();
 }
}
origin: commonsguy/cw-androidarch

 @NonNull
 @Override
 public Result doWork() {
  File downloadedFile=new File(getInputData().getString(KEY_ZIPFILE));
  File dir=getApplicationContext().getCacheDir();
  String resultDirData=getInputData().getString(KEY_RESULTDIR);
  File resultDir=new File(dir, resultDirData==null ? "results" : resultDirData);

  try {
   ZipUtils.unzip(downloadedFile, resultDir, 2048, 1024*1024*16);
   downloadedFile.delete();
  }
  catch (Exception e) {
   Log.e(getClass().getSimpleName(), "Exception unZIPing file", e);

   return ListenableWorker.Result.failure();
  }

  return ListenableWorker.Result.success();
 }
}
origin: zhiwei1990/android-jetpack-demo

  @NonNull
  @Override
  public Result doWork() {
    //在workRequest中传递来的data,
    Data data = getInputData();
    String name = data.getString("name");
    int age = data.getInt("age", 0);
    //do some work
    Log.i("test", "worker doWork() name: " + name + " age: " + age);
    //返回任务的结果数据,
    Data out = new Data.Builder()
        .putString("result", "哈哈哈,真的可以返回呀")
        .putInt("status", 200)
        .build();
    return Result.success(out);
  }
}
origin: rsiebert/TVHClient

  @NonNull
  @Override
  public Result doWork() {
    Timber.d("Loading channel icons from server");
    EpgSyncIntentService.enqueueWork(getApplicationContext(), new Intent().setAction("loadChannelIcons"));
    return Result.success();
  }
}
origin: WangDaYeeeeee/Mysplash

@NonNull
@Override
public Result doWork() {
  if (MuzeiUpdateHelper.update(getApplicationContext(), this)) {
    return Result.success();
  } else {
    return Result.failure();
  }
}
origin: owntracks/android

  @NonNull
  @Override
  public Result doWork() {
    Timber.i("MQTTReconnectWorker Doing work (%s)",Thread.currentThread());
    return messageProcessor.statefulCheckConnection() ? Result.success() : Result.retry();
  }
}
origin: owntracks/android

  @NonNull
  @Override
  public Result doWork() {
    Timber.v("SendLocationPingWorker doing work");
    locationProcessor.publishLocationMessage(MessageLocation.REPORT_TYPE_PING);
    return Result.success();
  }
}
origin: owntracks/android

  @NonNull
  @Override
  public Result doWork() {
    Timber.v("MQTTKeepaliveWorker doing work");
    return messageProcessor.statefulSendKeepalive() ? Result.success() : Result.retry();
  }
}
androidx.workListenableWorker$Resultsuccess

Popular methods of ListenableWorker$Result

  • failure
  • retry

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • getExternalFilesDir (Context)
  • getSupportFragmentManager (FragmentActivity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now