Hi,
When I click the Url, I see that I get a 301 Moved
Permanently, then the Actual Url gets loaded.
That is why the Browser get loaded.
I think you need to override shouldOverrideUrlLoading and
return true. (Have not tested it)
webv1.SetWebViewClient(new WebViewClient() {
private string _lastUrl ="";
public override bool ShouldOverrideUrlLoading(WebView view, string url)
{
if (_lastUrl != url)
{
_lastUrl = url
view.LoadUrl(url);
return true;
}
return false;
}
});
Hope this helps. I have not tested an actual 301 request, but
using the above code to load in my project for straight web pages.
Usually you subclass WebViewClient and created a Class which Overrides
the above method and other methods like OnReceivedError to handle
error.
Hope this helps.
Best Regards,
Sridharan Srinivasan
Alias Sri.
On Thu, Oct 6, 2011 at 11:15 PM, John Murray <[email protected]> wrote:
> I have a webview into which I want to put the results of a call to a remote
> php
>
>
>
> If one puts this into the address field of a browser a well formatted screen
> showing weather data is displayed
>
>
>
> fnm=
> “http://adds.aviationweather.gov/metars/index.php?submit=1&station_ids=EGHH&chk_metars=on&chk_tafs=on&std_trans=translated”
>
>
>
> I am using a webview elsewhere to display charst and images – these simply
> fill the screen and there is none of the usual browser accoutrements such as
> address line and toolbars etc - a plain image is shown – which is all I
> want
>
>
>
> Putting the same into a webview thus
>
> webv1.LoadUrl(fnm);
>
> causes my webview to show with nothing in it then it seems to shell out to
> a complete browser with all the address line etc with of course my required
> information in nicely formatted text
>
> pressing the back button goes back to the blank webview
>
> How can I cause the call to the php to deliver the result into the first
> simple webview rather than calling a new browser window /
>
> The code is so simple – I cant see what to do next! Should I be calling
> the PHP from a webclient ? and trying to load the result from that
>
> I’ve experimented a little using webview.LoadData but just achieved a lot of
> gobbledegook in the webview
>
> Any suggestions gratefully received
>
>
>
> SetContentView(Resource.Layout.metar);
>
> WebView webv1 = FindViewById<WebView>(Resource.Id.synopsimage);
>
> Button bCancel = FindViewById<Button>(Resource.Id.cancelbutton);
>
> bCancel.Text = "Go back";
>
> bCancel.Click += delegate { Finish(); };
>
> //webv1.Settings.JavaScriptEnabled = true;
>
> string fnm =
> "http://adds.aviationweather.gov/metars/index.php?submit=1&station_ids=EGHHsubmit=1&station_ids=EGHH&chk_metars=on&chk_tafs=on&std_trans=translated";
>
> webv1.LoadUrl(fnm);
>
>
>
>
>
> TIA
>
> John Murray
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Monodroid mailing list
> [email protected]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
--
Sridharan Srinivasan
Alias Sri
Ph:(65)98255785/(65)63922439
www.arshu.com
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid