title: get resource from a fragment
body: <p>I'm trying to change the source of an ImageButton in android within a fragment.</p>
  
  <p>I want to use the method Image.setImageResource() , however i can't use getResources() within the fragment. is there a way round this? getActivity().getResources() does not return any results unfortuantely.</p>
  
  <p>I've tried writing a string such as "R.drawable." + {different image names} but i cannot convert that string to an int.</p>
  
  <p>How else could this be done?</p>
  
  <p>I just want to change some imageButtons with source files dependent on different things.</p>