{"id":2307,"date":"2022-08-30T15:23:46","date_gmt":"2022-08-30T15:23:46","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/05\/android-view-inflateexception-binary-xml-file-line-7-error-inflating-class-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:23:46","modified_gmt":"2022-08-30T15:23:46","slug":"android-view-inflateexception-binary-xml-file-line-7-error-inflating-class-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/android-view-inflateexception-binary-xml-file-line-7-error-inflating-class-collection-of-common-programming-errors\/","title":{"rendered":"android.view.InflateException: Binary XML file line #7: Error inflating class-Collection of common programming errors"},"content":{"rendered":"<p>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:<\/p>\n<pre><code>package org.me.TicTacToe.ui;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.Paint.Style;\nimport android.view.MotionEvent;\nimport android.view.View;\n\npublic class TicTacToeBoard extends View {\n\n    private Tile[][] tile = null;   \/\/Abstract class to create tiles in Tic Tac Toe Board\n    int boardWidth = 3; \/\/It mean Tic Tac Toe board is consists of 3x3 tiles\n    private int width;\n    private int height;\n    private Paint brush;\n\n    public TicTacToeBoard(Context context) {\n        super(context);\n\n        brush = new Paint();\n        this.brush.setARGB(255, 0, 0, 0);\n        this.brush.setAntiAlias(true);\n        this.brush.setStyle(Style.STROKE);\n        this.brush.setStrokeWidth(5);\n\n        width = this.getWidth();\n        height = this.getHeight();\n\n        initBoard();\n    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        for (int i = 0; i &lt; tile.length; i++) {\n            for (int j = 0; j &lt; tile[0].length; j++) {\n                tile[i][j].draw(canvas, getResources(), j, i,\n                    (this.getWidth() + 3) \/ tile.length,\n                    this.getHeight() \/ tile[0].length);\n            }\n        }\n\n        int xs = this.getWidth() \/ boardWidth;\n        int ys = this.getHeight() \/ boardWidth;\n        for (int i = 0; i<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2014-01-05 10:08:14. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>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 = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2307","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2307"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2307\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}