I'm overriding ShouldInterceptRequest in a WebViewClient so I can load a
local resource , but when I try to load the resource I get the error:

System.NotSupportedException: Unable to activate instance of type
Android.Runtime.InputStreamAdapter from native handle

Any ideas why?

C# code:
public override WebResourceResponse ShouldInterceptRequest( WebView view,
string url )
{
     Log.Debug( "ShouldInterceptRequest Url = ", url );

        if( Url.IsDeviceUrl( url ) )
        {
        string Res = Url.DeviceResourse( url );

            Log.Debug( "ShouldInterceptRequest Res = ", Res );

            using( var stream = Owner.Assets.Open( Res ) )
           {
                return new WebResourceResponse( Res.ToLower().EndsWith( "js" ) ?
"text/javascript" : "text/css", "utf-8", stream );
           }
        }
        return base.ShouldInterceptRequest( view, url );
}

Thanks in advance.
Terry.





--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/System-NotSupportedException-Unable-to-activate-instance-of-type-Android-Runtime-InputStreamAdapter-e-tp5710381.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to