Próbuję wczytać adres URL w widoku internetowym. Adres URL prowadzi do pliku pdf na stronie internetowej. Chcę wyświetlić ten plik pdf w widoku webowym. Z jakiegoś powodu widzę tylko biały ekran, a plik PDF się nie ładuje.Ładowanie adresu URL z monodroidową wyskakującą przeglądarką internetową
Oto kod:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Webkit;
namespace TrackandTrace.Droid
{
[Activity (Label = "PodActivity")]
public class PodActivity : Activity
{
public string PodUrl { get; set; }
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.PodLayout);
var PodWebView = FindViewById<WebView> (Resource.Id.webViewPod);
PodUrl = Intent.GetStringExtra ("PodUrlString" ?? "No Pod Data available");
PodWebView.Settings.AllowFileAccess = true;
PodWebView.Settings.JavaScriptEnabled = true;
PodWebView.Settings.BuiltInZoomControls = true;
PodWebView.LoadData (PodUrl);
PodWebView.SetWebViewClient (new PodWebViewClient());
// Create your application here
}
private class PodWebViewClient : WebViewClient
{
public override bool ShouldOverrideUrlLoading (WebView view, string url)
{
view.LoadUrl (url);
return true;
}
}
}
}