title: Calling activity Method from inside fragment
body: <p>I'm trying to pass a value to a fragment from its container activity.</p>
  
  <p>I was trying do do it this way:</p>
  
  <p>I have this method in the Activity.</p>
  
  <pre><code>public int showMode(){return Mode;} 
  </code></pre>
  
  <p>And this method in the Fragment:</p>
  
  <pre><code>public int getModeFromActivity(){
      int i;
      i = getActivity().showMode;
          return i;
  </code></pre>
  
  <p>but it gives me the error in the fragment method: <em>showMode cannot be resolved or is not a field</em></p>
  
  <p>Can anyone help me fix this? thanks!</p>