Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. /**
  2. * doAlert() für Warn- und Rückfragedialoge
  3. *
  4. * @param mixed context
  5. * @param mixed title
  6. * @param mixed message
  7. * @param boolean status
  8. */
  9. @SuppressWarnings("deprecation")
  10. public void doAlert(Context context, String title, String message, Boolean status) {
  11. AlertDialog alertDialog = new AlertDialog.Builder(context).create();
  12.  
  13. alertDialog.setTitle(title); // Titel
  14. alertDialog.setMessage(message); // Nachricht
  15.  
  16. if (status != null) {
  17. alertDialog.setIcon((status) ? R.drawable.success : R.drawable.fail); // Icon Bild
  18. }
  19.  
  20. // OK Button
  21. alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
  22. @Override
  23. public void onClick(final DialogInterface dialog, final int which) {
  24.  
  25. }
  26. });
  27.  
  28. alertDialog.show();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement