permission changes to reference anonymous inner class correctly