I want to show locations name both in English and local language like Maps app show in android.
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
private final static String TAG = MapsActivity.class.getSimpleName();
private GoogleMap mMap;
private SupportMapFragment mapFragment;
private String language = "bn";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
Locale locale = new Locale(language);
Locale.setDefault(locale);
Configuration config = new Configuration();
if(Build.VERSION.SDK_INT>Build.VERSION_CODES.JELLY_BEAN){
config.setLocale(locale);
getContext().createConfigurationContext(config);
}else { //deprecated
config.locale = locale;
getResources().updateConfiguration(config, getResources().getDisplayMetrics());
}
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
LatLng dhaka = new LatLng(23.8103, 90.4125);
mMap.addMarker(new MarkerOptions().position(dhaka));
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(dhaka,10f));
}
}
But when i run this code all locations name in map is in English. But i want to the output like this
here where the location name is both in English and Bengali.