0

How to set action to POST on opening a browser using intent

Here's my current code:

Intent browserIntent;
browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url);
startActivity(browserIntent);
AllenC
  • 2,592
  • 1
  • 32
  • 67

1 Answers1

0

I am afraid , it's not possible with the browser. However you can achive it using Webview and its postUrl() method.

String url = "http://www.google.com";
String post_Data = "username=uname&password=pwd";
webview.postUrl(url,EncodingUtils.getBytes(postData, "BASE64"));
Ritesh Gune
  • 16,450
  • 6
  • 42
  • 70