android - How can I send a "fire and forget" async call with Retrofit? -


i'd send async requests never return response (logging, business events, etc). supported retrofit?

use empty callback:

public final class callbacks {   private static final callback<object> empty = new callback<object> {     @override public void success(object value, response response) {}     @override public void failure(retrofiterror error) {}   }    @suppresswarnings("unchecked")   public static <t> callback<t> empty() {     return (callback<t>) empty;   } } 

and in code:

apiservice.someendpoint(callbacks.empty()); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -