xamarin-Android发布模式失败(调试工作)

时间:2017-07-07 14:40:09

标签: android xamarin.android

not protected override void OnCreate(Bundle bundle)         {             base.OnCreate(束);

        // Set our view from the "main" layout resource
        SetContentView (Resource.Layout.Main);


        string link = "http://www.google.com";
        HttpWebRequest iNetRequest = (HttpWebRequest)WebRequest.Create(link);

        HttpWebResponse response = null;
        response = (HttpWebResponse)iNetRequest.GetResponse();
        StreamReader _str2 = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(936));
        string html = _str2.ReadToEnd();
        Toast.MakeText(this, html.Substring(0, 200), ToastLength.Long).Show();
    }

}

上述简单代码适用于调试模式,但不适用于发布模式。即使我已经在AndroidManifest.xml中添加了Internet权限。有人有什么理想吗?最好的祝福。    AndroidManifest.xml

0 个答案:

没有答案