{"action":"created","issue":{"url":"https://api.github.com/repos/diogobernardino/WilliamChart/issues/98","repository_url":"https://api.github.com/repos/diogobernardino/WilliamChart","labels_url":"https://api.github.com/repos/diogobernardino/WilliamChart/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/diogobernardino/WilliamChart/issues/98/comments","events_url":"https://api.github.com/repos/diogobernardino/WilliamChart/issues/98/events","html_url":"https://github.com/diogobernardino/WilliamChart/issues/98","id":123314134,"number":98,"title":"NPE upon drawline in RecyclerView","user":{"login":"rubinovk","id":2063487,"avatar_url":"https://avatars.githubusercontent.com/u/2063487?v=3","gravatar_id":"","url":"https://api.github.com/users/rubinovk","html_url":"https://github.com/rubinovk","followers_url":"https://api.github.com/users/rubinovk/followers","following_url":"https://api.github.com/users/rubinovk/following{/other_user}","gists_url":"https://api.github.com/users/rubinovk/gists{/gist_id}","starred_url":"https://api.github.com/users/rubinovk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rubinovk/subscriptions","organizations_url":"https://api.github.com/users/rubinovk/orgs","repos_url":"https://api.github.com/users/rubinovk/repos","events_url":"https://api.github.com/users/rubinovk/events{/privacy}","received_events_url":"https://api.github.com/users/rubinovk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/diogobernardino/WilliamChart/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-21T16:43:14Z","updated_at":"2016-03-24T18:22:45Z","closed_at":null,"body":"hey Diogo! Thank you very much for the great library. \r\nI've attempted to display BarChart charts within `RecyclerView` and I consistently get NPE at:\r\n`onDraw`->`drawHorizontalGrid`->`canvas.drawLine()` whenever `RecyclerView` shows me an item that was hidden, recycled and then showed again.\r\nI tried to debug the issue, but the only result I've got so far is that I can avoid the exception if I do not create nor set the grid paint object for a chart.\r\nI have some hypotheses, but not sure 100%. I suspect that it has to do with `style.clean()` that is called in `onDetachedFromWindow()` in `ChartView` and resets the paint object. \r\nThanks"},"comment":{"url":"https://api.github.com/repos/diogobernardino/WilliamChart/issues/comments/200959216","html_url":"https://github.com/diogobernardino/WilliamChart/issues/98#issuecomment-200959216","issue_url":"https://api.github.com/repos/diogobernardino/WilliamChart/issues/98","id":200959216,"user":{"login":"XxPixX","id":4924141,"avatar_url":"https://avatars.githubusercontent.com/u/4924141?v=3","gravatar_id":"","url":"https://api.github.com/users/XxPixX","html_url":"https://github.com/XxPixX","followers_url":"https://api.github.com/users/XxPixX/followers","following_url":"https://api.github.com/users/XxPixX/following{/other_user}","gists_url":"https://api.github.com/users/XxPixX/gists{/gist_id}","starred_url":"https://api.github.com/users/XxPixX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XxPixX/subscriptions","organizations_url":"https://api.github.com/users/XxPixX/orgs","repos_url":"https://api.github.com/users/XxPixX/repos","events_url":"https://api.github.com/users/XxPixX/events{/privacy}","received_events_url":"https://api.github.com/users/XxPixX/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T18:22:45Z","updated_at":"2016-03-24T18:22:45Z","body":"@narger17 \r\nAs a temporary workaround you can override onAttachedToWindow in your view containing the Chart and set the grid Paint then like so:\r\n\r\n@Override\r\n    protected void onAttachedToWindow() {\r\n        super.onAttachedToWindow();\r\n        chart.setGrid(ChartView.GridType.FULL, 5, 5, chartGridPaint);\r\n    }"}}