android.webkit.WebView.getWindowToken()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(270)

本文整理了Java中android.webkit.WebView.getWindowToken()方法的一些代码示例,展示了WebView.getWindowToken()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.getWindowToken()方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:getWindowToken

WebView.getWindowToken介绍

暂无

代码示例

代码示例来源:origin: cSploit/android

@Override
 public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
  if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
   mWebView.loadUrl(mURLet.getText().toString());
   InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
   imm.hideSoftInputFromWindow(mWebView.getWindowToken(), 0);
   mWebView.requestFocus();
   return true;
  }
  return false;
 }
});

代码示例来源:origin: cSploit/android

@Override
 public boolean onKey(View v, int keyCode, KeyEvent event) {
  if (event.getAction() == KeyEvent.ACTION_DOWN
      && event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
   mWebView.loadUrl(mURLet.getText().toString());
   InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
   imm.hideSoftInputFromWindow(mWebView.getWindowToken(), 0);
   mWebView.requestFocus();
   return true;
  }
  return false;
 }
});

代码示例来源:origin: stackoverflow.com

public class WebViewActivity extends DashBoardActivity {
/** Called when the activity is first created. */
WebView ourBrow;

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.webview);

  ourBrow = (WebView)findViewById(R.id.wvBrowser);

  ourBrow.getSettings().setJavaScriptEnabled(true);
  ourBrow.getSettings().setLoadWithOverviewMode(true);
  ourBrow.getSettings().setUseWideViewPort(true);
  ourBrow.setWebViewClient(new ourViewClient());

  ourBrow.loadUrl(www.indianbloggerpost.com);

  //hiding the keyboard after using an EditText
  InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
  imm.hideSoftInputFromWindow(ourBrow.getWindowToken(), 0);


}

相关文章

WebView类方法