android.view.InflateException: Binary XML file line #7: Error inflating class-Collection of common programming errors
I get error message when trying to run my Project. I want to create Tic Tac Toe for Android, and I use custom View below to create Tic Tac Toe board:
package org.me.TicTacToe.ui;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.view.MotionEvent;
import android.view.View;
public class TicTacToeBoard extends View {
private Tile[][] tile = null; //Abstract class to create tiles in Tic Tac Toe Board
int boardWidth = 3; //It mean Tic Tac Toe board is consists of 3x3 tiles
private int width;
private int height;
private Paint brush;
public TicTacToeBoard(Context context) {
super(context);
brush = new Paint();
this.brush.setARGB(255, 0, 0, 0);
this.brush.setAntiAlias(true);
this.brush.setStyle(Style.STROKE);
this.brush.setStrokeWidth(5);
width = this.getWidth();
height = this.getHeight();
initBoard();
}
@Override
protected void onDraw(Canvas canvas) {
for (int i = 0; i < tile.length; i++) {
for (int j = 0; j < tile[0].length; j++) {
tile[i][j].draw(canvas, getResources(), j, i,
(this.getWidth() + 3) / tile.length,
this.getHeight() / tile[0].length);
}
}
int xs = this.getWidth() / boardWidth;
int ys = this.getHeight() / boardWidth;
for (int i = 0; i