Skip to content Skip to sidebar Skip to footer

Side Effects Of Calling Activity.setcontentview() Twice In A Row

In my app I needed to call findViewbyId() from both onCreate() and from WebChromeClient.onCompletion(). To avoid findViewbyId() returning null I resorted to calling Activity.setCon

Solution 1:

There is no problem in doing so. You have to reinitialize references (every findViewById needs to be called again) and it might be troublesome if you do it A LOT of times, but it is not a time bomb at all.


Post a Comment for "Side Effects Of Calling Activity.setcontentview() Twice In A Row"