Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Keyboard does not work with webpage that contains Javascript

I have created an application that links to another site, this site has a form (and some javascript in the background)

Due to whatever javascript the page has on any Android 2.2-2.3 device tapping on an Input field does not bring up the soft keyboard and when you force it up you are unable to input anything at all.

My ICS device works perfectly fine with the site (I'm guessing due to the updated mobile browser)

Is there any code I can add to my project that will allow the older 2.2 and 2.3 devices to properly run the javascript or be able to handle the websites input fields correctly?

Here is the site I'm having the issues with: http://fhsdschools.revtrak.net/tek9.asp?pg=products&grp=1

like image 315
Brent Hacker Avatar asked Jul 14 '26 19:07

Brent Hacker


1 Answers

I faced a similar issue with web view. There is some issue with the focus when we enable the java script. I tried redirecting the focus on touch and the issue was solved. This is what i did:

wv.requestFocus(View.FOCUS_DOWN);
        wv.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                case MotionEvent.ACTION_UP:
                    if (!v.hasFocus()) {
                        v.requestFocus();
                    }
                    break;
                }
                return false;
            }
        });

I hope this will help.

like image 143
karn Avatar answered Jul 18 '26 13:07

karn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!