How can I display Arabic text in the info window of a Google map?

I need to display Arabic text in the google map info window, each with its own infowindow.

Marker marker = googleMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)) .title(companyName).snippet(companyName)); CameraPosition cameraPosition = new CameraPosition.Builder().target( new LatLng(latitude, longitude)).zoom(12).build(); googleMap.getUiSettings().setZoomGesturesEnabled(false); googleMap.getUiSettings().setCompassEnabled(true); googleMap.getUiSettings().setRotateGesturesEnabled(true); googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)); marker.showInfoWindow(); 
+5
source share
2 answers

which is so simple for the rtl language of course, I think the error is when you write .title ("عربی") android show blank infowindow. but you should use this command .title ("\ u200e" + "عربی")

+4
source

I have the same problem. I just found that the Google Maps Android SDK 2.0 marker information window is empty if the device language is set to Arabic, Hebrew, Persian or Urdu (i.e. Right to Left Language) and the transmitted string is in the same language. I checked this with Android Studio to make sure the string is in the correct language. The value of the line is correct when stopping at a breakpoint in AS, but not in the information window of the device (the window is empty). This may have something to do with my device that does not fully support these languages, or it may be a bug in the SDK (or both).

+2
source

Source: https://habr.com/ru/post/1203622/


All Articles