diff --git a/redwood-treehouse-host/src/androidMain/kotlin/app/cash/redwood/treehouse/TreehouseLayout.kt b/redwood-treehouse-host/src/androidMain/kotlin/app/cash/redwood/treehouse/TreehouseLayout.kt index 25e7a30da5..272ac269c9 100644 --- a/redwood-treehouse-host/src/androidMain/kotlin/app/cash/redwood/treehouse/TreehouseLayout.kt +++ b/redwood-treehouse-host/src/androidMain/kotlin/app/cash/redwood/treehouse/TreehouseLayout.kt @@ -25,6 +25,7 @@ import androidx.activity.OnBackPressedDispatcher as AndroidOnBackPressedDispatch import app.cash.redwood.treehouse.TreehouseView.ReadyForContentChangeListener import app.cash.redwood.treehouse.TreehouseView.WidgetSystem import app.cash.redwood.widget.RedwoodLayout +import app.cash.treehouse.host.R import java.util.UUID @Deprecated( @@ -58,9 +59,8 @@ public class TreehouseLayout( override var saveCallback: TreehouseView.SaveCallback? = null init { - // The view needs to have an id for Android to populate saved data back - @SuppressLint("ResourceType") - id = 9000 + // The view needs to have an ID to participate in instance state saving. + id = R.id.treehouse_layout } override fun onAttachedToWindow() { diff --git a/redwood-treehouse-host/src/androidMain/res/values/ids.xml b/redwood-treehouse-host/src/androidMain/res/values/ids.xml new file mode 100644 index 0000000000..677db48916 --- /dev/null +++ b/redwood-treehouse-host/src/androidMain/res/values/ids.xml @@ -0,0 +1,18 @@ + + + +