This exception is usually thrown if you work with an invalid context. What are you passing to the Constructor of your aaa class? If you pass getApplicationContext()
it may fail. Try passing the context of the activity which is responsible for displaying your view (usually with the reference this
).