Softkeyboard pops up automatically first time the webview loads
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.
精彩评论