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

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

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

WebView.postUrl介绍

暂无

代码示例

代码示例来源:origin: Justson/AgentWeb

@Override
public void postUrl(final String url, final byte[] postData) {
  if (!AgentWebUtils.isUIThread()) {
    mHandler.post(new Runnable() {
      @Override
      public void run() {
        postUrl(url, postData);
      }
    });
    return;
  }
  this.mWebView.postUrl(url, postData);
}

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

public void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);

  WebView webView = new WebView(this);

  setContentView(webView);

  String url = "http://example.com/somepage.php";
  String postData = "postvar=value&postvar2=value2";

  webView.postUrl(url, EncodingUtils.getBytes(postData, "base64"));
}

代码示例来源:origin: luili16/UIMocker

@Override
public void postUrl(String url, byte[] postData) {
  mWebView.postUrl(url,postData);
}

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

String postData = cookie.getName() + "=" + cookie.getValue();
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.setWebViewClient(new HelloWebViewClient());
myWebView.postUrl(loadUrl,EncodingUtils.getBytes(postData, "BASE64") );

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

final WebView webview = (WebView) findViewById(webView);
   webview.getSettings().setJavaScriptEnabled(true);
   webview.getSettings().setLoadWithOverviewMode(true);
   webview.getSettings().setUseWideViewPort(true);
   webview.getSettings().setBuiltInZoomControls(true);
   webview.postUrl("https://www.youtube.com/watch?v=IlWhW9u5fzM", "");

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

public class MyWebviewActivity extends Activity {
  WebView mWebView;
  ....
  ....
  ....
  @Override
  public void onRestart() {
      String url = mWebView.getUrl();
      String postData = MyUtility.getOptionsDataForPOSTURL(mContext);
      mWebView.postUrl(url, EncodingUtils.getBytes(postData, "BASE64"));
  }
}

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

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  WebView webView = new WebView(this);
  setContentView(webView);

  String url = "http://mysite.com/somepage.php";
  String postData = "postvar=value";

  webView.postUrl(url, EncodingUtils.getBytes(postData, "base64"));
}

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

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  WebView webView = new WebView(this);
  setContentView(webView);    
  String url = "http://example.com/somepage.php";
  String postData = "postvar=value";    
  webView.postUrl(url, EncodingUtils.getBytes(postData, "base64"));
}

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

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  WebView webv = (WebView)findViewById(R.id.MainActivity_webview);         
  webv.setWebViewClient(new WebViewClient(){
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        return true;
      }
  });

  String postData = FIELD_NAME_LOGIN + "=" + LOGIN +
      "&" + FIELD_NAME_PASSWD + "=" + PASSWD;

  // this line logs you in and you stay logged in
  // I suppose it works this way because in this case WebView handles cookies itself
  webv.postUrl(URL, EncodingUtils.getBytes(postData, "utf-8"));
}

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

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  WebView webv = (WebView)findViewById(R.id.MainActivity_webview);         
  webv.setWebViewClient(new WebViewClient(){
      @Override
      public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        return true;
      }
  });

  String postData = FIELD_NAME_LOGIN + "=" + LOGIN +
      "&" + FIELD_NAME_PASSWD + "=" + PASSWD;

  // this line logs you in and you stay logged in
  // I suppose it works this way because in this case WebView handles cookies itself
  webv.postUrl(URL, EncodingUtils.getBytes(postData, "utf-8"));
}

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

+ "&furl=failure.php&lastname=qwerty&curl=dsdsd.com&address1=dsdsds&address2=dfdfd&city=dsdsds&state=dfdfdfd&"
    + "country=fdfdf&zipcode=123456&udf1=dsdsds&udf2=fsdfdsf&udf3=jhghjg&udf4=fdfd&udf5=fdfdf&pg=dfdf";
webView.postUrl(
    "http://host/payment.php",
    EncodingUtils.getBytes(postData, "BASE64"));

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

webviewPayment.postUrl(url_s.toString(),EncodingUtils.getBytes(getPostString(), "utf-8"));

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

webView1.postUrl(url,EncodingUtils.getBytes(postData, "BASE64"));

代码示例来源:origin: ckcz123/PKUHelper-Android

headers.put("User-token", Constants.user_token);
  webView.loadUrl(url, headers);
} else webView.postUrl(url, postArea.getBytes());
return this;

代码示例来源:origin: payu-intrepos/Android-SDK-Sample-App

mWebView.postUrl(url, payuConfig.getData().getBytes());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.postUrl(url, payuConfig.getData().getBytes());

相关文章

WebView类方法