1 |
package dk.thoerup.traininfo.util;
|
2 |
|
3 |
import android.app.Activity;
|
4 |
import android.app.AlertDialog;
|
5 |
import android.content.DialogInterface;
|
6 |
|
7 |
public class MessageBox {
|
8 |
|
9 |
public static void showMessage(final Activity cntx, String message, final boolean finish) {
|
10 |
AlertDialog.Builder builder = new AlertDialog.Builder(cntx);
|
11 |
builder.setMessage(message)
|
12 |
.setCancelable(false)
|
13 |
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
14 |
public void onClick(DialogInterface dialog, int id) {
|
15 |
dialog.dismiss();
|
16 |
if (finish == true) {
|
17 |
cntx.finish();
|
18 |
}
|
19 |
}
|
20 |
})
|
21 |
.show();
|
22 |
|
23 |
}
|
24 |
}
|