Ok, here is a complete app that exhibits the problem. The key that is
necessary is to
do a setContentView from the menuItem/onClick/onLongClick. It doesn't
help if you
postpone it either, eg using handler.postDelayed() and such.
This is a rather serious bug for anything that uses a WebView.
The framework of the app is taken straight from the Android Hello World app.
Mike
PS: I've filed a bug report, but if anybody else has seen this, and/or
found a
work around, I'd be happy to hear it.
--- cut here ---
package com.example.android.helloactivity;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
/**
* A minimal "Hello, World!" application.
*/
public class HelloActivity extends Activity {
public HelloActivity() {
}
/**
* Called with the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set the layout for this activity. You can find it
// in res/layout/hello_activity.xml
setContentView(R.layout.hello_activity);
}
public boolean onCreateOptionsMenu (Menu menu) {
boolean result = super.onCreateOptionsMenu(menu);
menu.add(0, 0, Menu.NONE, "Test");
return result;
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case 0:
WebView w = new WebView (this);
w.loadData("<html><body>fooz <input></body></html>",
"text/html",
"utf8");
setContentView (w);
break;
}
//return super.onOptionsItemSelected(item);
return false;
}
}
On 03/16/2010 08:12 AM, Mark Murphy wrote:
mike wrote:
Can somebody from google please comment?
In case you haven't noticed, the percentage of questions that get asked
here that get answered by Google is fairly small.
this seems like a pretty
serious error in the webview's if you can't type into a html input or
textarea
box on, oh say, the N1. Which is what I'm seeing out in the field.
I cannot reproduce your problem.
WebView w = new WebView (this);
w.loadData("<html><body>fooz<input></body></html>", "text/html",
"utf8");
setContentView (w);
which shows a single input box. There is now way just tapping around the
screen to get it to accept input.
Using your own code, the soft keyboard appears quite nicely on:
-- the T-Mobile G1 (1.6)
-- the Google Ion (1.5)
-- the Nexus One (2.1)
-- the Motorola DROID (2.0.1)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en