title: Get current location with marker in android studio
body: <p>How to find current location with a marker. This code it finds the location but how to show the marker in current location?</p>
  
  <pre><code> public void onSearch (View view)
      {
          ibtn = (ImageButton)findViewById(R.id.imageSearchButton);
          EditText location_tf = (EditText) findViewById(R.id.editTextSearch);
          String  location = location_tf.getText().toString();
          List&lt;Address&gt; addressList = null;
  
          if(location != null || !location.equals(""))
          {
              Geocoder geocoder = new Geocoder(this);
              try{
                  addressList = geocoder.getFromLocationName(location, 1);
              }catch (IOException e)
              {
                  e.printStackTrace();
              }
  
              Address address = addressList.get(0);
              LatLng latLng = new LatLng(address.getLatitude(), address.getLongitude());
              mMap.addMarker(new MarkerOptions().position(latLng).title("Accidents Here"));
              mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));
  
          }       
      }
  </code></pre>