Created
May 14, 2013 08:49
-
-
Save NavjotSinghTung/5574584 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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