Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ime callback not found. Ignoring unregisterReceivedCallback

I am a noob in mobile app development.

Scenario

Within Dialog, within Column, I have a text field and a Button. (Button belongs to material3. For the text field, I have tried various ones available under android.widget as well as androidx.compose.material3)

The Composable function containing the Dialog is invoked from another Composable using navController.navigate. The button, on click, makes an API call via ViewModel via Repository and then invokes navController.popBackStack().

Problem

When the IME keyboard is open for the text field, if I click on the button, then I get the error.

Ime callback not found. Ignoring unregisterReceivedCallback. callbackId: 77948589

When the keyboard is not open, if I click on the button, then there's no error.

What I have tried

Have tried multiple things, including focusManager.clearFocus() at the beginning of the button click, specifying imeAction = ImeAction.None as part of text field's keyboardOptions.

The problem is similar to that mentioned in Android Ime callback not found issue on AlertDialog dismiss, but that doesn't contain any solution.

Details about the App.

  • Compose only
  • Android SDK 14.0 API Level 34 Revision 3
  • Build tool Gradle 8.6
  • Kotlin Compiler 1.9.0 Language version 2.0 API version 2.0 JVM Target 1.8
  • Dependencies I included: ViewModel 2.8.0, Navigation 2.7.7, Retrofit 2.11.0, Moshi 1.14.0 (Everything else default - Empty Activity project created just 3 days ago)
like image 672
S R Samy Avatar asked Aug 14 '26 09:08

S R Samy


1 Answers

Late answer, but Google got me here so if anyone else has an issue:

I found this article. Basically, the ime options need to be set. I also needed to clean the project (as always!) and now the error's gone. My code is:

OutlinedTextField(
    value = authKey,
    onValueChange = {
        // ....
    },
    keyboardActions = KeyboardActions(
        onNext = {
            keyboardController?.hide()
        },
        onSend = {
            keyboardController?.hide()
        },
        onDone = {
            keyboardController?.hide()
        }
    ),
    keyboardOptions = KeyboardOptions(
        imeAction = ImeAction.Done
    ),
    label = { Text("authorisation phrase.." },
    modifier = Modifier.fillMaxWidth(1.0f),
    colors = OutlinedTextFieldDefaults.colors(
        focusedContainerColor = Color.Transparent,
        unfocusedContainerColor = Color.Transparent,
        unfocusedTextColor =Color.hsv(hue = 0.0f, saturation = 0.0f, value = 0.9f),
        focusedTextColor = Color.White,
        unfocusedLabelColor = Color.hsv(hue = 0.0f, saturation = 0.0f, value = 0.9f),
        focusedLabelColor = Color.White,
        focusedBorderColor = Color.White,
        unfocusedBorderColor = Color.White
    )
)
like image 141
Todd Avatar answered Aug 15 '26 22:08

Todd