{"action":"opened","issue":{"url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/296","labels_url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/296/comments","events_url":"https://api.github.com/repos/neokree/MaterialNavigationDrawer/issues/296/events","html_url":"https://github.com/neokree/MaterialNavigationDrawer/issues/296","id":77209342,"number":296,"title":"Adding account from Fragment","user":{"login":"phanghos","id":1209351,"avatar_url":"https://avatars.githubusercontent.com/u/1209351?v=3","gravatar_id":"","url":"https://api.github.com/users/phanghos","html_url":"https://github.com/phanghos","followers_url":"https://api.github.com/users/phanghos/followers","following_url":"https://api.github.com/users/phanghos/following{/other_user}","gists_url":"https://api.github.com/users/phanghos/gists{/gist_id}","starred_url":"https://api.github.com/users/phanghos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phanghos/subscriptions","organizations_url":"https://api.github.com/users/phanghos/orgs","repos_url":"https://api.github.com/users/phanghos/repos","events_url":"https://api.github.com/users/phanghos/events{/privacy}","received_events_url":"https://api.github.com/users/phanghos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-17T04:25:07Z","updated_at":"2015-05-17T04:25:07Z","closed_at":null,"body":"I'm trying to add an account from a Fragment. What am I doing wrong? Am I missing something? I can do it from the main activity with no problem, but I need to do it from a Fragment. I'm using standard code:\r\n\r\n    MaterialAccount account = new MaterialAccount(getResources(), \"title\", \"subtitle\", photo, background);\r\n    context.addAccount(account);\r\n\r\nThis seems to be the Exception it throws, which did not help at all:\r\n\r\n    java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable it.neokree.materialnavigationdrawer.elements.MaterialAccount.getCircularPhoto()' on a null object reference"}}