[mono-android] System.NotSupportedException: Unable to activate instance of type Android.Runtime.InputStreamAdapter from native handle

Terry151151 Terry at Terry-Watts.com
Sun Jun 17 12:16:29 UTC 2012


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.


More information about the Monodroid mailing list