title: Android: Fragmentmanager in Widget Subclass
body: <p>I Created a Subclass of Button to get a Button with some extra functionality.<br>
  In this subclass I created an innerclass which implements OnClickListener to use it as an Onclicklistener for this Buttonclass.</p>
  
  <p>There are three buttons of this class which are added to my MainActivity. Whenever I click on this Button I want to change a Fragment on in the same Activity.<br>
  So I need to get a Fragmentmanager in my Button- or OnclickListener-Subclasses.</p>
  
  <p>What is the best Way to achieve this? </p>
  
  <p>A Way I could imagine is to create a setter in my button to set a fragment manager from my MainActivity. But I don't think this is a very good way.</p>