congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SpiceManager.addListenerIfPending
Code IndexAdd Tabnine to your IDE (free)

How to use
addListenerIfPending
method
in
com.octo.android.robospice.SpiceManager

Best Java code snippets using com.octo.android.robospice.SpiceManager.addListenerIfPending (Showing top 3 results out of 315)

origin: com.octo.android.robospice/robospice

/**
 * Add listener to a pending request if it exists. If no such request
 * exists, this method calls onRequestNotFound on the listener. If a request
 * identified by clazz and requestCacheKey, it will receive an additional
 * listener.
 * @param clazz
 *            the class of the result of the pending request to look for.
 * @param requestCacheKey
 *            the key used to store and retrieve the result of the request
 *            in the cache
 * @param requestListener
 *            the listener to notify when the request will finish.
 */
public <T> void addListenerIfPending(final Class<T> clazz, final Object requestCacheKey, final PendingRequestListener<T> requestListener) {
  addListenerIfPending(clazz, requestCacheKey, (RequestListener<T>) requestListener);
}
origin: com.octo.android.robospice/robospice

@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" })
@Override
public final void onStart(final Intent intent, final int startId) {
  super.onStart(intent, startId);
  notificationId = intent.getIntExtra(BUNDLE_KEY_NOTIFICATION_ID, DEFAULT_ROBOSPICE_NOTIFICATION_ID);
  requestClass = (Class<?>) intent.getSerializableExtra(BUNDLE_KEY_REQUEST_CLASS);
  requestCacheKey = intent.getStringExtra(BUNDLE_KEY_REQUEST_CACHE_KEY);
  spiceServiceClass = (Class<? extends SpiceService>) intent.getSerializableExtra(BUNDLE_KEY_SERVICE_CLASS);
  if (spiceServiceClass == null) {
    throw new RuntimeException("Please specify a service class to monitor. Use #createIntent as helper.");
  }
  foreground = intent.getBooleanExtra(BUNDLE_KEY_FOREGROUND, true);
  spiceManager = new SpiceManager(spiceServiceClass);
  notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  spiceManager.start(this);
  spiceManager.addListenerIfPending(requestClass, requestCacheKey, new NotificationRequestListener());
  if (foreground) {
    startForeground(notificationId, onCreateForegroundNotification());
  }
}
origin: n76/wifi_backend

@Override
public void onStart() {
  super.onStart();
  if(!hasStartedRequest) {
    getSpiceManager().execute(getRequest(), getCacheKey(), DurationInMillis.ALWAYS_EXPIRED, this);
    hasStartedRequest = true;
  } else {
    getSpiceManager().addListenerIfPending(getRequest().getResultType(), getCacheKey(), this);
  }
}
com.octo.android.robospiceSpiceManageraddListenerIfPending

Javadoc

Add listener to a pending request if it exists. If no such request exists, this method calls onRequestNotFound on the listener. If a request identified by clazz and requestCacheKey, it will receive an additional listener.

Popular methods of SpiceManager

  • execute
  • shouldStop
    Stops the SpiceManager. It will unbind from SpiceService. All request listeners that had been regist
  • start
    Start the SpiceManager. It will bind asynchronously to the SpiceService.
  • <init>
    Creates a SpiceManager. Typically this occurs in the construction of an Activity or Fragment. This m
  • addRequestListenerToListOfRequestListeners
  • addSpiceServiceListener
  • bindToService
  • checkServiceIsProperlyDeclaredInAndroidManifest
  • dontNotifyAnyRequestListenersInternal
    Remove all listeners of requests. All requests that have not been yet passed to the service will see
  • dontNotifyRequestListenersForRequestInternal
    Internal method to remove requests. If request has not been passed to the SpiceService yet, all list
  • executeCommand
  • getContextReference
  • executeCommand,
  • getContextReference,
  • getThreadCount,
  • isStarted,
  • match,
  • putInCache,
  • removeListenersOfAllPendingCachedRequests,
  • removeListenersOfCachedRequestToLaunch,
  • removeListenersOfPendingCachedRequest

Popular in Java

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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