Computer scienceMobileAndroidUser InterfaceUI components

Instantiating Views programmatically

Defining an ID

Report a typo

For the given code,

override fun onCreate(savedInstanceState: Bundle?) {
    setContentView(ScrollView(this).apply {
        id = R.id.main_scroll

        // layout goes here
    })
}

fill in the blank to make it work.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <item __________________ type="id" />
    <!-- more items… -->
</resources>
Enter a short text
___

Create a free account to access the full topic