0

I am having trouble opening the browser by sending data via post. Using the HTML form would be as follows:

<form method='post' action='https://cieloecommerce.cielo.com.br/transactional/order/buynow' target='blank'>
<input type='hidden' name='id' value=xyz-xyz-xyz-xyz-xyz'
/>
<input type='image' name='submit' alt='Comprar' src='{Button Image}'>
</form>

However, when I make a call Intent in the Android browser opens a page with error. I like this:

private String idCielo;

[...]

@Override
                    public void onClick(View view) {
                        Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://cieloecommerce.cielo.com.br/transactional/order/buynow"+idCielo));
                            getActivity().startActivity(browserIntent);

                    }

OR

@Override
                    public void onClick(View view) {
                        Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://cieloecommerce.cielo.com.br/transactional/order/buynow”));
                       browserIntent.putExtra("id",idCielo); 

                            getActivity().startActivity(browserIntent);

                    }

Please can help me. I must pass the value to post and open the page in a browser externally. Thank you!

Zorzal
  • 1
  • 1
  • possible duplicate of [How can I open android browser with specified POST parameters?](http://stackoverflow.com/questions/4119827/how-can-i-open-android-browser-with-specified-post-parameters) – e4c5 Sep 30 '15 at 15:26

1 Answers1

1

just call the ACTION.VIEW intent and set a datasource to it

 Intent i = new Intent(Intent.ACTION_VIEW);
 i.setData(Uri.parse("http://www.StackOverFlow.com"));
 startActivity(i);
Vaibhav Barad
  • 625
  • 8
  • 17