1 |
torben |
245 |
package dk.thoerup.traininfo.util;
|
2 |
|
|
|
3 |
torben |
906 |
import android.app.Activity;
|
4 |
torben |
245 |
import android.app.AlertDialog;
|
5 |
|
|
import android.content.DialogInterface;
|
6 |
|
|
|
7 |
|
|
public class MessageBox {
|
8 |
|
|
|
9 |
torben |
906 |
public static void showMessage(final Activity cntx, String message, final boolean finish) {
|
10 |
torben |
245 |
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 |
torben |
906 |
if (finish == true) {
|
17 |
|
|
cntx.finish();
|
18 |
|
|
}
|
19 |
torben |
245 |
}
|
20 |
|
|
})
|
21 |
|
|
.show();
|
22 |
|
|
|
23 |
|
|
}
|
24 |
|
|
}
|