开发者

Softkeyboard pops up automatically first time the webview loads

开发者 https://www.devze.com 2023-03-26 07:37 出处:网络
Apparently there are no editboxes or anything which needs a keyboard on the webpage either. 开发者_Go百科and this dos\'nt work either even on user interaction event.

Apparently there are no editboxes or anything which needs a keyboard on the webpage either.

开发者_Go百科

and this dos'nt work either even on user interaction event.

public void onUserInteraction()
    {
        super.onUserInteraction();
        InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(webView.getWindowToken(), 0);

    }

This is the log from logcat.

http://pastebin.com/i5q0axk9


If your concern is how to open URL then you try this and it is the tested code:

Uri uri = Uri.parse(URL);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent); 


In your AndroidManifest.xml

use android:configChanges="orientation|keyboardHidden"

e.g

<activity android:name=".YourActivity" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden"></activity>

Worked for me, Hope helps you also.

0

精彩评论

暂无评论...
验证码 换一张
取 消