"TicTacToe cannot be cast to android.view.View$OnClickListener", you accidentally imported Dialog listener:
import android.content.DialogInterface.OnClickListener;
When you actually should have imported View.OnClickListener
import android.view.View.OnClickListener;
So, since the Activity is implementing the wrong listener, by the time the activity is created it just crashes because of a ClassCastException.
Just remove the first import and replace with the second one or do this in you activity class declaration(make sure you are not registering that click listener in a widget you need DialogInterface.OnClickListener):
public class TicTacToe extends Activity implements View.OnClickListener
Regards!