Fix crash by using context's getResources