| 13 | } |
| 14 | |
| 15 | function createAlertDialog(options?: DialogOptions): android.app.AlertDialog.Builder { |
| 16 | const alert = new android.app.AlertDialog.Builder(androidUtils.getCurrentActivity(), options.theme ? options.theme : -1); |
| 17 | alert.setTitle(options && isString(options.title) ? options.title : ''); |
| 18 | alert.setMessage(options && isString(options.message) ? options.message : ''); |
| 19 | if (options && options.cancelable === false) { |
| 20 | alert.setCancelable(false); |
| 21 | } |
| 22 | |
| 23 | return alert; |
| 24 | } |
| 25 | |
| 26 | function showDialog(builder: android.app.AlertDialog.Builder) { |
| 27 | const dlg = builder.show(); |