com.netmera.mobile
Class NetmeraCallback<T>

java.lang.Object
  extended by com.netmera.mobile.NetmeraCallback<T>
Type Parameters:
T - - Type of the NetmeraCallback object.

public abstract class NetmeraCallback<T>
extends java.lang.Object

NetmeraCallback is used to run code with response data coming from Netmera after the background thread finishes running.

The code that do the main job runs on the background thread, however the onSuccess(Object) and onFail(NetmeraException) methods run on the main thread. This ensures that main thread will not freeze while doing operations on data.


Constructor Summary
NetmeraCallback()
           
 
Method Summary
abstract  void onFail(NetmeraException exception)
          After the code finishes running override this method to distinguish failures easily.
abstract  void onSuccess(T result)
          After the code finishes running override this method to get the results.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetmeraCallback

public NetmeraCallback()
Method Detail

onSuccess

public abstract void onSuccess(T result)
After the code finishes running override this method to get the results.

Parameters:
result - - Object that returns after running the code.

onFail

public abstract void onFail(NetmeraException exception)
After the code finishes running override this method to distinguish failures easily.

Parameters:
exception - - Callback falls into this method if it cannot access server/server does not permit current operation or there is no result to show.