Package com.swrve.sdk
Class UIThreadSwrveUserResourcesListener
- java.lang.Object
-
- com.swrve.sdk.UIThreadSwrveUserResourcesListener
-
- All Implemented Interfaces:
SwrveUserResourcesListener
public class UIThreadSwrveUserResourcesListener extends java.lang.Object implements SwrveUserResourcesListener
This helper class is used to run UI logic to handle the result of Swrve::getUserResources() Note: the Runnable uiWork will be called from the context of the Activity.
-
-
Constructor Summary
Constructors Constructor Description UIThreadSwrveUserResourcesListener(android.app.Activity context, UIThreadSwrveResourcesRunnable uiWork)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onUserResourcesError(java.lang.Exception exception)
Called back on error.void
onUserResourcesSuccess(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> resources, java.lang.String resourcesAsJSON)
This method is invoked asynchronously to return the request response of the Swrve::getUserResources().
-
-
-
Constructor Detail
-
UIThreadSwrveUserResourcesListener
public UIThreadSwrveUserResourcesListener(android.app.Activity context, UIThreadSwrveResourcesRunnable uiWork)
-
-
Method Detail
-
onUserResourcesSuccess
public void onUserResourcesSuccess(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> resources, java.lang.String resourcesAsJSON)
Description copied from interface:SwrveUserResourcesListener
This method is invoked asynchronously to return the request response of the Swrve::getUserResources(). Note: this method is invoked from a different thread than the thread used to call Swrve::getUserResources().- Specified by:
onUserResourcesSuccess
in interfaceSwrveUserResourcesListener
- Parameters:
resources
- the resources represented as a map in the form uid = (attribute_name=attribute_value).resourcesAsJSON
- the resources as JSON.
-
onUserResourcesError
public void onUserResourcesError(java.lang.Exception exception)
Description copied from interface:SwrveUserResourcesListener
Called back on error.- Specified by:
onUserResourcesError
in interfaceSwrveUserResourcesListener
- Parameters:
exception
- Exception caused when trying to obtain user resources.
-
-