Back to project page bv-android-sdk.
The source code is released under:
Apache License
If you think the Android project bv-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.bazaarvoice.intentexample; /*from w w w. j a v a 2s. c om*/ import org.json.JSONObject; import android.app.Activity; import android.util.Log; import com.bazaarvoice.OnBazaarResponse; public abstract class BazaarUIThreadResponse implements OnBazaarResponse { private Activity context; public BazaarUIThreadResponse(Activity context){ this.context = context; } /** * Prints the error and stack trace to Logcat. * * @param message * the error message * @param exception * the exception that caused the problem */ public void onException(String message, Throwable exception) { Log.e("ERROR", message + "\n" + exception.getMessage()); } /** * Calls onUiResponse(JSONObject) on the UI thread. * * @param response * the JSONObject containing the response */ public void onResponse(JSONObject response) { final JSONObject myResponse = response; this.context.runOnUiThread(new Runnable() { @Override public void run() { onUiResponse(myResponse); } }); } /** * Called on the UI thread when the response is received. * * @param response * the JSONObject containing the response */ public abstract void onUiResponse(JSONObject response); }