title: Trying to get a button and edittext to not appear for a android app
body: <p>I have a Android App that uses Google Maps, if the GPS acquire a connection to the Android Device I have a Button and EditText that I do not want to show up.  The code for the On Create method is below.</p>
  
  <p>If the isGPS is true the button and label still show up.  I acutally want to have the button and the edittext not appear when isGPS is true.
  Any help would be appreciated.</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
  
      final boolean isGPS = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
      setContentView(R.layout.activity_map_view_wogps);
  
      showCurrentLocationOnMap(); 
  
      // Getting reference to btn_find of the layout activity_main
      Button btn_find = (Button) findViewById(R.id.btn_find);
      final EditText etLocation = (EditText) findViewById(R.id.et_location);
      if (isGPS){
          btn_find.setVisibility(View.GONE);
          etLocation.setVisibility(View.GONE);
      }
      // Defining button click event listener for the find button
      OnClickListener findClickListener = new OnClickListener() {
          @Override
          public void onClick(View v) {
  
              // Getting user input location
              String location = etLocation.getText().toString();
  
              if(location!=null &amp;&amp; !location.equals("")){
                  AsyncTask&lt;String, Void, List&lt;Address&gt;&gt; execute = new GeocoderTask().execute(location);
              }
          }
      };
  
      // Setting button click event listener for the find button
      btn_find.setOnClickListener(findClickListener);
  
  
  
  
      try {
          showSheltersAndFuelStops();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  
  }
  </code></pre>