Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(mMap != null && location != null){
- LatLng gps = new LatLng(location.getLatitude(),
- location.getLongitude());
- marker = mMap.addMarker(new MarkerOptions().position(gps).icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));
- marker.setDraggable(true);
- return marker;
- }
- return null;
- }
- public void drawMarker(View view) {
- if (marker == null) {
- Location loc = returnLocation();
- Double lat = loc.getLatitude();
- Double lon = loc.getLongitude();
- //para guardar un marker en sharedPreferences
- sharedPreferences.edit().putString("Lat",String.valueOf(lat)).apply();
- sharedPreferences.edit().putString("Lng",String.valueOf(lon)).apply();
- sharedPreferences.edit().putLong("time",System.currentTimeMillis()).apply();
- marker = addMarker(loc);
- dialogPlayas.dismiss();
- removeMarker.setVisibility(View.VISIBLE);
- }
- }
- customAdapter adapter = new customAdapter(this, imgid);
- list = (GridView) playasView.findViewById(R.id.list);
- list.setAdapter(adapter);
- list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
- listaReporte.add(list.getSelectedItem());
- }
- });
- //Log.i("Mostrando lista",listaReporte.getFirst().toString());
- addMarker = playasView.findViewById(R.id.addMarker);
- dialogPlayas = mBuilder.create();
- dialogPlayas.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
- dialogPlayas.show();
- }
Add Comment
Please, Sign In to add comment