title: Change a TextView Visibility in Fragment
body: <p>I have a some fragment in my PageViewer.
  In the main fragment, I would like to show a component ( TextView or imageView) if there is no connection.
  In the code below, I can reach my textview, but I cannot get them disapperead. </p>
  
  <pre><code>public class MainFragment extends Fragment {
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      View layout = inflater.inflate(R.layout.main, container, false);
  
  
  //      RelativeLayout mainLayout = (RelativeLayout)findViewById(R.layout.main);
      TextView TxtIsNotConnected = (TextView) layout.findViewById(R.id.isNotConnected);
      TextView TxtIsConnected = (TextView) layout.findViewById(R.id.isConnected);
  //      String text = TxtIsNotConnected.getText().toString(); // This is a test which works, return the text o my textview.
      boolean isConnected = ConnectivityUtils.isConnected(getActivity()); // This Works fine
      if (!isConnected) TxtIsNotConnected.setVisibility(View.VISIBLE); // NOT WORKING
      else              TxtIsConnected.setVisibility(View.VISIBLE); // NOT WORKING
  
      return inflater.inflate(R.layout.main, container, false);
  }
  </code></pre>
  
  <p>How should I do???</p>