title: How can I convert repetitive fragments into one to handle them
body: <p>I have 8 fragments which are similar between each other. I want to make a general fragment to manage all of these. I don´t have a clear idea how to acchieve this idea.</p>
  
  <p>My fragments have the same code, except layout, and 2 or 3 methods. So, I think that the best way is to have this in one fragment for all.</p>
  
  <p>What is the best way.</p>
  
  <p>Fragment 1.</p>
  
  <pre><code>public class Fragment1 extends Fragment {
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
        return inflater.inflate(R.layout.lm_fragment, container, false);
     }
  
     public void method(){}
  }
  </code></pre>
  
  <p>Fragment 2.</p>
  
  <pre><code>public class Fragment2 extends Fragment {
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
        return inflater.inflate(R.layout.lm_fragment, container, false);
     }
  
     public void method2(){}
  
     public void method3(){}
  }
  </code></pre>
  
  <p>Fragment X...</p>
  
  <p>Every fragment has the same structure, only changes between them in the methods of each fragment.</p>
  
  <p>I want to do:</p>
  
  <p>General Fragment to manage all cases, with a helper with the methods or something like that.</p>