How can I get the height of input field when using TouchScreenKeyboard?

I’m using TouchScreenKeyboard API and it activates keyboard and input field when I call TouchScreenKeyboard.Open()

I want to know the height of input field in android phone.

I found this code

using(AndroidJavaClass UnityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
        {
            AndroidJavaObject View = UnityClass.GetStatic<AndroidJavaObject>("currentActivity").Get<AndroidJavaObject>("mUnityPlayer").Call<AndroidJavaObject>("getView");
       
            using(AndroidJavaObject Rct = new AndroidJavaObject("android.graphics.Rect"))
            {
                View.Call("getWindowVisibleDisplayFrame", Rct);
           
                return Screen.height - Rct.Call<int>("height");
            }
        }

But, it seems to be getting the height of the keyboard.

How can I get the height of input field or the height of input field + keyboard?

The code provided in this thread worked for me: Keyboard height – even though it gives me some innocent(?) errors in logcat. I was searching for a solution when i bumped into your post.

The error i get is “Error DecorView mWindow.mActivityCurrentConfig is null” - if someone know a solution to this i’d be happy to hear :slight_smile: