(int questionResourceId, final Runnable action)
| 2071 | } |
| 2072 | |
| 2073 | public void askConfirmation(int questionResourceId, final Runnable action) { |
| 2074 | AlertDialog.Builder dlg = new AlertDialog.Builder(this); |
| 2075 | dlg.setTitle(questionResourceId); |
| 2076 | dlg.setPositiveButton(R.string.dlg_button_ok, new OnClickListener() { |
| 2077 | public void onClick(DialogInterface arg0, int arg1) { |
| 2078 | action.run(); |
| 2079 | } |
| 2080 | }); |
| 2081 | dlg.setNegativeButton(R.string.dlg_button_cancel, new OnClickListener() { |
| 2082 | public void onClick(DialogInterface arg0, int arg1) { |
| 2083 | // do nothing |
| 2084 | } |
| 2085 | }); |
| 2086 | dlg.show(); |
| 2087 | } |
| 2088 | |
| 2089 | //============================================================== |
| 2090 | // |
no test coverage detected