I have noticed the same behavior using the built in browser, and am looking
for a solution right now also. I am just in the process of creating 10 or 15
web pages for mobile apps, and this has me stopped right now.
If I find it I will let you know, but if anyone has the solution, it would
be appreciated.
Sincerely,
Brad Gies
-----------------------------------------------------------------
Brad Gies
27415 Greenfield Rd, # 2,
Southfield, MI, USA
48076
www.bgies.com www.truckerphone.com
www.EDI-Easy.com www.pricebunny.com
-----------------------------------------------------------------
Moderation in everything, including abstinence
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of ArtJin
Sent: Saturday, January 17, 2009 1:25 PM
To: Android Developers
Subject: [android-developers] Re: WebView html form POST problem
Hi, Fred. Thanks for reply.
Page loads inside current Activity. It does not open new browser
window ( this is exactly what I wanted it to do ).
Basically, its like implementing your own browser -> everything is
handled by WebView inside my app.
My problem is that WebView does not make POST request of an empty form
twice.
Here is paraphrased and step by step explanation of the problem.
My WebView loads the page from http://mydomain.com/example.php
The example.php has a form with one input text box <input type="text"
name="mytextbox"> and a submit button <input name="mybutton"
type="submit" value="Submit">.
This form is set to submit the data to itself (<form action="http://
mydomain.com/exmaple.php" method="POST">)
1) My app loads example.php with loadURL("http://mydomain.com/
example.php")
2 I click submit button -> my app makes post request and gets the same
page back, so I see the form again.
3) I click submit button again -> my app just sits there without
making any requests to the server any more.
4) I click again and again -> nothing happens.
5) I put some text in input text box and form starts working again,
meaning it submits the page to the server again.
So, I suspect that it has something to do with caching mechanism but I
am not sure.
Any ideas? Please let me know if you observed the same behavior
(solved or not solved :-)
If someone tries to replicate the situation please let me know how it
goes.
Thanks again everybody!
On Jan 16, 4:56 pm, "Fred Grott(shareme)" <[email protected]>
wrote:
> Sorry my mind is tired..I know I am missing something in your
> description
>
> Each time thewebviewloads pages are they al inwebviewor does any
> loading open a new browser view? You will know because the title bar
> of borwser flashes during the page load and says browser
>
> On Jan 16, 6:06 pm, ArtJin <[email protected]> wrote:
>
> > Hello everyone.
> > I am observing interesting behavior when usingWebViewto display HTML
> > forms.
> > The description of the problem is little confusing, but I am trying to
> > make it as short, and as understandable as possible.
> > Here is the description of the problem.
> > 1) I have a web page called example.php with a form in it like this.
> > <html>
> > <head>
> > <title>Example</title>
> > </head>
> > <body>
> > <form id="example_form" action="http://mydomain.com/example.php"
> > method="POST">
> > <input type="text" name="example_input">
> > <input type="submit" name="Do Post Request">
> > </form>
> > </body>
> > </html>
>
> > 3) I also have theWebViewbrowser = (WebView)findViewById
> > (R.id.webkit); which works just fine when loading pages with
> > browser.loadURL("http"//mydomain.com/example.php")
>
> > 2) I also want to handle all the link clicks on the page (if any)
> > inside my G1 application, therefore I have overridden
> > shouldOverrideUrlLoading(Webviewview, String url), returning true
> > from the method.
>
> > 3) When I click on "Do Post Request" button inside my G1 app, it
> > makes the post request tohttp://mydomain.com/example.phpandloads
> > the bage right back, so I can see the same form again.
>
> > 4) INTERESTING PART: If I click the "Do Post Request" button again,
> > G1 does not make requests to the server, unless I put something in the
> > input box. Does this have anything to do with cashing or am I missing
> > something?
> > Thanks a lot in advance for any ideas!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---