> For the complete documentation index, see [llms.txt](https://docs.live2.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.live2.ai/live2.ai-integration/in-app-language-switches.md).

# In-app Language Switches

The Live2.ai Android SDK supports the host app in dynamically changing languages at runtime. There are no specific API requirements for the host app to leverage this feature. The host app can implement its own mechanism for overriding the context, and the Live2.ai Android SDK will automatically update the **`PlayerActivity`'s `BaseContext`** to the desired locale. This update ensures that resources and layout alignment (LTR/RTL) reflect the current locale.

```kotlin
Kotlin:

class InAppLanguageActivity : FragmentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_in_app_language)
    }

    override fun attachBaseContext(newBase: Context) {
        super.attachBaseContext(LanguageHelper.changeLanguage(newBase))
    }

    override fun onCreateOptionsMenu(menu: Menu?): Boolean {
        menuInflater.inflate(R.menu.in_app_toolbar, menu)
        return true
    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        return when (item.itemId) {
            R.id.menu_en -> handleLanguageChange(getString(R.string.in_app_language_en))
            R.id.menu_hi -> handleLanguageChange(getString(R.string.in_app_language_hi))
            R.id.menu_de -> handleLanguageChange(getString(R.string.in_app_language_de))
            else -> super.onOptionsItemSelected(item)
        }
    }

    private fun handleLanguageChange(languageCode: String): Boolean {
        LanguagePreference.setLocalePreference(this, languageCode)
        recreate()
        return true
    }
}

```
