.cs file:
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().PermitAll().Build();
StrictMode.SetThreadPolicy(policy);
ImageView bmImage = FindViewById<ImageView>(Resource.Id.MyImageView);
URL url = new URL("http://www.fareast.com.sg/~/media/46521A05EEC4464CA457792591248373.ashx?20130715T1642469900");
Bitmap bmp = BitmapFactory.DecodeStream(url.OpenConnection().InputStream);
bmImage.SetImageBitmap(bmp);
.Mainfest File:
<uses-permission android:name="android.permission.INTERNET" />
.axml File:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/MyImageView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().PermitAll().Build();
StrictMode.SetThreadPolicy(policy);
ImageView bmImage = FindViewById<ImageView>(Resource.Id.MyImageView);
URL url = new URL("http://www.fareast.com.sg/~/media/46521A05EEC4464CA457792591248373.ashx?20130715T1642469900");
Bitmap bmp = BitmapFactory.DecodeStream(url.OpenConnection().InputStream);
bmImage.SetImageBitmap(bmp);
.Mainfest File:
<uses-permission android:name="android.permission.INTERNET" />
.axml File:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/MyImageView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
Good One..!
ReplyDelete