Skip to content

Calculate a custom tip: Android Basics with Compose [wrong parameter name of EditNumberField ] #324

@LinZhanzhi

Description

@LinZhanzhi

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-calculate-tip?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-calculate-tip#3

In which task and step of the codelab can this issue be found?
in step 4
4. Add a tip-percentage text field

Describe the problem

the parameter of composable EditNumberField, which is "onValueChanged", is wrong.
Correct parameter is "onValueChange"

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

it is the code snippets

Versions
Android Studio version:
API version of the emulator:

Android Studio Narwhal 4 Feature Drop | 2025.1.4
Build #AI-251.27812.49.2514.14217341, built on October 6, 2025
Runtime version: 21.0.8+-14018985-b1038.68 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
Kotlin plugin: K2 mode
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 24
Registry:
ide.experimental.ui=true
Non-Bundled Plugins:
com.github.copilot (1.5.57-243)

Properties
avd.ini.displayname Pixel 6
avd.ini.encoding UTF-8
AvdId Pixel_6
disk.dataPartition.size 6G
fastboot.chosenSnapshotFile
fastboot.forceChosenSnapshotBoot no
fastboot.forceColdBoot no
fastboot.forceFastBoot yes
hw.accelerometer yes
hw.arc false
hw.audioInput yes
hw.battery yes
hw.camera.back virtualscene
hw.camera.front emulated
hw.cpu.ncore 4
hw.device.hash2 MD5:2016577e1656e8e7c2adb0fac972beea
hw.device.manufacturer Google
hw.device.name pixel_6
hw.dPad no
hw.gps yes
hw.gpu.enabled yes
hw.gpu.mode auto
hw.gyroscope yes
hw.initialOrientation portrait
hw.keyboard yes
hw.lcd.density 420
hw.lcd.height 2400
hw.lcd.width 1080
hw.mainKeys no
hw.ramSize 2048
hw.sdCard yes
hw.sensors.light yes
hw.sensors.magnetic_field yes
hw.sensors.orientation yes
hw.sensors.pressure yes
hw.sensors.proximity yes
hw.trackBall no
image.sysdir.1 system-images\android-36\google_apis\x86_64
PlayStore.enabled false
runtime.network.latency none
runtime.network.speed full
showDeviceFrame yes
skin.dynamic yes
tag.display Google APIs
tag.displaynames Google APIs
tag.id google_apis
tag.ids google_apis
target android-36
vm.heapSize 228

Additional information
Include screenshots if they would be useful in clarifying the problem.

in step 3 the parameter is onValueChange

Image

but in step 4 it becomes onValueChanged

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions