I'm creating an map that shows a result from a Parse query. I can pass information directly into the marker, such as a title or a lat/long, but I would like to include some additional information (not to be displayed) that I can use when the user clicks on the marker. For instance when the user clicks on the marker, I would like to find the user's objectId from the Parse query (which is simply a string). I've tried the following code in the marker onClickListener to put the string in as an argument:
destPosition = marker.getPosition();
destLat = destPosition.latitude;
destLong = destPosition.longitude;
MarkerDialogFragment markerDialogFragment = new MarkerDialogFragment();
Bundle args = new Bundle();
args.putString("id", marker.getId());
args.putString("userId", userId);
args.putString("title", marker.getTitle());
args.putDouble("latitude", destLat);
args.putDouble("longitude", destLong);
markerDialogFragment.setArguments(args);
when I try to extract this data on the "other side" by getting the arguments, the userId always comes across as null...I've defined userId as such:
final String userId = parseUsers.get(i).getObjectId();
I've even tried hard coding the string in userId as such, and it still comes back as null when I try to get the arguments:
final String userId = "test userId";
Here is the get arguments code for the marker onCreateDialog method:
builder = new AlertDialog.Builder(getActivity());
final String markerId = getArguments().getString("id");
final String userId = getArguments().getString("userId");
final String title = getArguments().getString("title");
final double destLat = getArguments().getDouble("latitude");
final double destLong = getArguments().getDouble("longitude");
builder.setTitle(title)
When I use the debugger to stop the code to see the values, all data is set as expected and I have values for each item EXCEPT the userId. Can anyone help point me in the right direction? I simply want to pass a value associated with a variable and have it be tied to each marker created on the map. Thanks!