Skip to content

Instantly share code, notes, and snippets.

@NavjotSinghTung
Created May 14, 2013 08:49
Show Gist options
  • Save NavjotSinghTung/5574584 to your computer and use it in GitHub Desktop.
Save NavjotSinghTung/5574584 to your computer and use it in GitHub Desktop.
package com.gndec.gcm
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
public class AlertDialogManager {
// Function to display simple Alert Dialog
public void showAlertDialog(Context context, String title, String message,
Boolean status) {
AlertDialog alertDialog = new AlertDialog.Builder(context).create();
// Dialog Title
alertDialog.setTitle(title);
// Dialog Message
alertDialog.setMessage(message);
if(status != null)
// alert dialog icon
alertDialog.setIcon((status) ? R.drawable.success : R.drawable.fail);
// OK Button
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
// Alert Message
alertDialog.show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment