cancel
Showing results for 
Search instead for 
Did you mean: 

[Spatial SDK] Virtual keyboard is not shown.

BigMac1771
Honored Guest

Im executing the StarterSample on Quest3 v76.1024. I just add a EditText widget into ui_example.xml as below.

When I clicked the EditText, the virtual keyborad was not shown but sometime it was shown.

Here is the log filter by keyword "keyboard": log 

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="This is EditText"
android:textSize="20dp"
android:textColor="@color/design_default_color_error"
/>

<!--Button-->
<Button
android:id="@+id/ok_button"
android:layout_height="36dp"
android:layout_width="120dp"
android:layout_gravity="center"
android:text="Ok"
android:background="@drawable/button_bg"
android:textColor="#ffffff"
/>

 

1 ACCEPTED SOLUTION

Accepted Solutions

pmcgvr
Meta Employee

We are working on a framework-level fix for this. However in the meantime we have a solution that should unblock you.

In your main VR activity (inherits from AppSystemActivity) add this line into your onCreate:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)


So this would look like:

import android.view.WindowManager
...

class MyVRActivity : AppSystemActivity() {
...

  override fun onCreate(savedInstanceState: Bundle?) {
    ...
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)
  }
}

 

View solution in original post

3 REPLIES 3

pmcgvr
Meta Employee

Thank you for reporting this, the engineering team is looking into the issue.

pmcgvr
Meta Employee

We are working on a framework-level fix for this. However in the meantime we have a solution that should unblock you.

In your main VR activity (inherits from AppSystemActivity) add this line into your onCreate:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)


So this would look like:

import android.view.WindowManager
...

class MyVRActivity : AppSystemActivity() {
...

  override fun onCreate(savedInstanceState: Bundle?) {
    ...
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)
  }
}

 

it works, thanks.