On 03/17/2010 03:04 PM, Mark Murphy wrote:
mike wrote:
We already proved that what you did here worked yesterday.
I don't want to setContentView to the webview initially. I want
to be able to paint up a screen and switch to the webview later,
via user control (ie, a button/menuitem).
Then make the WebView have visibility of GONE at the outset. Or use a
ViewFlipper.

1) I don't know what you mean by "never implement a constructor
     in an Activity".
I mean "never implement a constructor in an Activity". Anything you
might have in a constructor should go in onCreate(), and a do-nothing
constructor, like you had, is in the pointless-to-dangerous range.

We're not communicating. Are you saying that the only time
I should do a new XX() is *only* in onCreate? That can't possibly
be what you mean, and it's impossible to avoid in practice anyway.

And I have no idea what you mean by "do-nothing". It was constructing
a WebView. That's hardly "nothing". In any case, pre-constructing the
WebView doesn't change anything in the outcome. I had already tried
that.

2) it doesn't matter where the constructor for the WebView is
     called. It's the second setContentView call being called from the
     menu/button click method that's causing the problem seemingly.

3) the return value of the onMenu doesn't affect the outcome here
Points 1-3 were pointing out flaws in your code. Since you seem to be
pointing out flaws in other people's code, I figured you would be
interested to know where you are making other mistakes that might impact
your activity working properly.

Look, I'm only trying to figure out why such an obvious thing as
an html input or textarea can't gain keyboard focus after I switch
to a WebView. I'm not here to score points against google or anybody
else. I hacked up that minimal program to demonstrate how easy it
is to reproduce. I'm sorry that it had a mistake that didn't make
any difference in the outcome.

Mike, I'll look at view flipper. View.GONE would be really cumbersome and inelegant

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to