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

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

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

WebView.requestFocus介绍

暂无

代码示例

代码示例来源: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: 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: TommyLemon/APIJSON

webSettings.setJavaScriptEnabled(true);
wvWebView.requestFocus();

代码示例来源:origin: TommyLemon/Android-ZBLibrary

webSettings.setJavaScriptEnabled(true);
wvWebView.requestFocus();

代码示例来源:origin: googlesamples/android-testing

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_web_view);
  mWebView = (WebView) findViewById(R.id.web_view);
  mWebView.getSettings().setJavaScriptEnabled(true);
  mWebView.loadUrl(urlFromIntent(getIntent()));
  mWebView.requestFocus();
  mWebView.setWebViewClient(new WebViewClient() {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
      return false;
    }
  });
}

代码示例来源:origin: HotBitmapGG/bilibili-android-client

mWebView.getSettings().setBlockNetworkImage(true);
mWebView.setWebViewClient(webViewClient);
mWebView.requestFocus(View.FOCUS_DOWN);
mWebView.getSettings().setDefaultTextEncodingName("UTF-8");
mWebView.setWebChromeClient(new WebChromeClient() {

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

webView.requestFocus(View.FOCUS_DOWN);

代码示例来源:origin: sunfusheng/MarqueeView

webView.requestFocus();

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

mWebView.requestFocus();

代码示例来源:origin: sunfusheng/StickyHeaderListView

webView.requestFocus();

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

public class MainActivity extends Activity {
  private class MyWebViewClient extends WebViewClient {
     @Override
     public boolean shouldOverrideUrlLoading(WebView view, String url) {
       view.loadUrl(url);
       return true;
     }
  }
  Button btnBack;
  WebView webview;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    webview=(WebView)findViewById(R.id.webview1);
    webview.setWebViewClient(new MyWebViewClient());
    openURL();
  }

   /** Opens the URL in a browser */
  private void openURL() {
    webview.loadUrl("http://www.google.com");
    webview.requestFocus();
  }
}

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

WebView foll_fb = (WebView) findViewById(R.id.btn_foll_fb);    
String url = "http://www.facebook.com/plugins/like.php?layout=standard&show_faces=true&width=80&height=50&action=like&colorscheme=light&href=YOUR_URL_TO_LIKE";              
foll_fb.loadUrl(url);
foll_fb.getSettings().setJavaScriptEnabled(true);
foll_fb.requestFocus(View.FOCUS_DOWN);
foll_fb.setWebViewClient(new LikeWebviewClient());

代码示例来源:origin: BoBoMEe/Android-Demos

@Override
  public void onNext(User user) {
    loginInfoWeb.loadUrl(user.html_url);
    loginInfoWeb.requestFocus(View.FOCUS_DOWN);
    loginInfoText.setText(user.html_url);
    preferencesHelper.putAccessToken(user.html_url);
  }
};

代码示例来源:origin: apps4av/avare

/**
   * 
   */
  @Override
  public void onResume() {
    super.onResume();
    Helper.setOrientationAndOn(this);
    
    mWebView.requestFocus();

  }
}

代码示例来源:origin: apps4av/avare

@Override
public void onResume() {
  super.onResume();
  
  Helper.setOrientationAndOn(this);
  /*
   * Registering our receiver Bind now.
   */
  Intent intent = new Intent(this, StorageService.class);
  getApplicationContext().bindService(intent, mConnection,
      Context.BIND_AUTO_CREATE);
  mWebView.requestFocus();
}

代码示例来源:origin: apps4av/avare

@Override
public void onResume() {
  super.onResume();
  
  Helper.setOrientationAndOn(this);
  /*
   * Registering our receiver Bind now.
   */
  Intent intent = new Intent(this, StorageService.class);
  getApplicationContext().bindService(intent, mConnection,
      Context.BIND_AUTO_CREATE);
  
  mWebView.requestFocus();        
}

代码示例来源:origin: apps4av/avare

@Override
public void onResume() {
  super.onResume();
  
  Helper.setOrientationAndOn(this);
  /*
   * Registering our receiver Bind now.
   */
  Intent intent = new Intent(this, StorageService.class);
  getApplicationContext().bindService(intent, mConnection,
      Context.BIND_AUTO_CREATE);
  mWebView.requestFocus();
}

代码示例来源:origin: apps4av/avare

@Override
public void onResume() {
  super.onResume();
  
  Helper.setOrientationAndOn(this);
  /*
   * Registering our receiver Bind now.
   */
  Intent intent = new Intent(this, StorageService.class);
  getApplicationContext().bindService(intent, mConnection,
      Context.BIND_AUTO_CREATE);
  
  mWebView.requestFocus();        
}

代码示例来源:origin: geniusgithub/Look-Around

private void onUIReady(View view){
  ButterKnife.bind(this, view);
  mWebView.setVerticalScrollBarEnabled(false);
  mWebView.setHorizontalScrollBarEnabled(false);
  mWebView.requestFocus();
  WebSettings webSettings = mWebView.getSettings();
  webSettings.setJavaScriptEnabled(true);
  webSettings.setBuiltInZoomControls(true);
  webSettings.setSupportZoom(true);
  webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
  initData(getParentActivity().getIntent());
}

代码示例来源:origin: namndbka/QDict

private void showCaptureWindow() {
  show(DEFAULT_ID);
  setKeywordLable(mClipboardText);
  makeDictContent(mClipboardText);
  if (mDictViewContent != null && !mDictViewContent.hasFocus())
    mDictViewContent.requestFocus();
}

相关文章

WebView类方法