Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //AlertDialoge class
- public class AlertDialogManager
- {
- public void showAlertDialog(Context context,String title, String message, Boolean status)
- {
- AlertDialog alertDialog = new AlertDialog.Builder(context).create();
- alertDialog.setTitle(title);
- alertDialog.setMessage(message);
- new AlertDialog.Builder(
- new ContextThemeWrapper(context, android.R.style.Theme_Dialog));
- if(status!=null)
- {
- alertDialog.setIcon((status)? R.drawable.success :R.drawable.fail);
- }
- alertDialog.setButton("OK", new DialogInterface.OnClickListener()
- {
- @Override
- public void onClick(DialogInterface arg0, int arg1)
- {
- }
- });
- alertDialog.show();
- }
- }
- // call it in any class as you wish like
- alert.showAlertDialog(CurrencyConversion.this, "Internet Connection Error", "Please connect to working Internet connection", false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement