如何使用屏蔽package com.example.acedzubair.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class MainActivity extends AppCompatActivity {
private WebView myWebView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WebView myWebView = (WebView) findViewById(R.id.webView);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.loadUrl("http://yo.com/");
myWebView.setWebViewClient(new WebViewClient());
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
if (myWebView.canGoBack()) {
myWebView.goBack();
} else {
return super.onKeyDown(keyCode, event);
}
return true;
}
}
return super.onKeyDown(keyCode, event);
}
}
过滤矢量v
,如下所示?
m
答案 0 :(得分:0)
您可以将v
向量转换为逻辑对象,并使用它来对 v = c(1, 2, 3, 4, 5)
m = c(1, 0, 0, 1, 1)
v[as.logical(m)]
[1] 1 4 5
进行索引。
UIViewControllers