Back to project page Android-SDK-Demo.
The source code is released under:
Apache License
If you think the Android project Android-SDK-Demo 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.baasbox.demo.util; /*www . ja v a 2s . co m*/ import android.app.AlertDialog; import android.content.Context; import com.baasbox.android.BaasClientException; import com.baasbox.android.BaasException; import com.baasbox.android.BaasServerException; public class AlertUtils { public static void showErrorAlert(Context context, BaasClientException e) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(true); builder.setTitle("Client Error"); builder.setMessage("An unexpected app error: " + e.httpStatus + " (" + e.code + ") :" + e.getMessage()); builder.setNegativeButton("Cancel", null); builder.create().show(); } public static void showErrorAlert(Context context, BaasServerException e) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(true); builder.setTitle("Server Error"); builder.setMessage("An unexpected server error: " + e.httpStatus + " (" + e.code + "):" + e.getMessage()); builder.setNegativeButton("Cancel", null); builder.create().show(); } public static void showErrorAlert(Context context, BaasException e) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(true); builder.setTitle("Error"); builder.setMessage("An unexpected error: " + e.getMessage()); builder.setNegativeButton("Cancel", null); builder.create().show(); } }