1

I have build a sort of split view for one of my android applications. I have made an activity which is a container of a listview and a framelayout. I use the listview for a menu and in my framelayout, I load views of different activities. I have read the source code of the TabHost for building this system.

Activities that I load in my framelayout could contain a webview.

The system work pretty well but I have a big issue. When I click on a field in a webview, the soft keyboard doesn't appear and typing on the physical keyboard has no affect.

I have made many many researches and I found nothing :'( I really appreciate if somebody could give me an idea for solving this issue.

RorolePro
  • 11
  • 1

2 Answers2

0

It is a known issue and has been reported as solved in the unreleased version of android, Gingerbread.

See the following link, it may well provde helpful, with one user quoting the following work around:

Hi, I had the same problem opening a WebView in a Dialog, after some random tries I found that if I create a subclass of WebView and override onCheckIsTextEditor() works fine.

class MyWebView extends WebView {

public MyWebView(Context context) {
    super(context);
}

@Override
public boolean onCheckIsTextEditor() {
    return true; 
}
}

The link:

http://code.google.com/p/android/issues/detail?id=7189

Another possible solution to try is:

webView.requestFocus(View.FOCUS_DOWN);

See the following post:

Why is Android WebView refusing user input?

Community
  • 1
  • 1
Scoobler
  • 9,696
  • 4
  • 36
  • 51
0

To show the soft keyboard in a webview, I added this line :

webview.requestFocusFromTouch();

And it's work well.

But, If I load an activity with an EditText, I haven't solved the issue. When I click on an EditText, the soft keyboard is never shown.

RorolePro
  • 11
  • 1