Just recently, context.getResources().updateConfiguration()
has been deprecated in Android API 25 and I need to change language of my app which user selects. I am using this method to change language
private void setLanguage(String language){
Locale locale = new Locale(language);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
con.getApplicationContext().getResources().updateConfiguration(config, null);
prefData.setCurrentLanguage(language);
Intent intent = new Intent(getApplicationContext(),MainActivity.class);
startActivity(intent);
finish();
}
But getting Deprecated api warning, I have just started android development. So any suggestion will be helpful on how to resolve this warning.