Open stratbasher opened 9 years ago
Maybe create a runnable or other sort of function that wraps the Ion call. Then run it when you need it.
The problem is that I need my LoginSafeFutureCallback to be used in a variety of other functions as well, all which have different request parameters and URLs. I'm not entirely sure as to how I would be able to organize the code to work that way.
What would you recommend for passing the function-wrapped Ion call through the LoginSafeFutureCallback?
Hello,
I'm trying to create my own FutureCallback function that will run allow me to run a callback and automatically have the custom callback check the response. If the response matches a certain requirement, another request is made, then the ORIGINAL request is made again.
Basically, make a request, check if the response is valid. If not, the user is not logged in. Run the login function using credentials in SharedPreferences, then when they are logged in, re-run the original callback.
Currently, I am trying to pass in the ResponseFuture as an argument to my new callback function Like this:
In my fragment
My LoginSafeFutureCallback class
This doesn't seem to work, as the actual web request seems to be made during the asJsonArray() function.
Is there any way to repeat a request or save the full thing before executing?