fix getResources() fragment not attached crash