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,754
  • 1
  • 41
  • 74

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,629
  • 6
  • 44
  • 72