I create a custom view which showing the simple game
I set the custom view in the MainActivity
setContentView(new CustomView())
In this custom view, only have few ball and the timer
When a ball touch another ball. The timer will stop and show the result.
I don't know how to show the result in a better way. So i tried to create a dialog to show the result.
This code is write in the CustomView class
if (ballIsTouch) {
AlertDialog alertDialog = new AlertDialog.Builder(getContext()).create();
alertDialog.setTitle("Result");
alertDialog.setMessage(point);
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}
However, the page is freezed. The dialog haven't show.