Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Implicit setContentView in onCreate doesn't work in 0.8 #114

Closed
h0tk3y opened this issue Dec 2, 2015 · 1 comment
Closed

Implicit setContentView in onCreate doesn't work in 0.8 #114

h0tk3y opened this issue Dec 2, 2015 · 1 comment

Comments

@h0tk3y
Copy link

h0tk3y commented Dec 2, 2015

The following code worked in 0.7.3 and works no more in 0.8:

fun ui() = frameLayout { id = FRAGMENT_HOLDER_ID }

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    ui()
    fragmentManager.beginTransaction().replace(FRAGMENT_HOLDER_ID, HelloFragment()).commit()
}

In debugger I see that in onCreate after ui() call findViewById(FRAGMENG_HOLDER_ID) returns null, while in 0.7.3 it returns the FrameLayout.

If I change the call to setContentView(ui()), it works.

@h0tk3y h0tk3y changed the title Setting id doesn't work Setting id doesn't work in 0.8 Dec 2, 2015
@h0tk3y h0tk3y changed the title Setting id doesn't work in 0.8 Implicit setContentView in onCreate doesn't work in 0.8 Dec 2, 2015
@yanex
Copy link
Member

yanex commented Dec 3, 2015

Fixed in 9fddf09.

@yanex yanex added fixed and removed open labels Dec 3, 2015
@yanex yanex closed this as completed Dec 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants