title: How to detect keyboard language in textview?
body: <p><a href="https://i.stack.imgur.com/FnGoZ.jpg" rel="nofollow noreferrer">enter image description here</a>      </p>
  
  <pre><code>binding.etShortText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
          @Override
          public void onFocusChange(View v, boolean hasFocus) {
              if (hasFocus) {
                  String language = getKeyboardLanguage();
                  Log.d("language is", language);
                  binding.txtDetectLang.setText(language);
              }
          }
      });
  }
  
  private String getKeyboardLanguage() {
      InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
      InputMethodSubtype inputMethodSubtype = inputMethodManager.getCurrentInputMethodSubtype();
      return inputMethodSubtype.getLocale();
  }
  
  </code></pre>