イメージをアンドロイドで表示しようとしています。プロセスはネットから1イメージをダウンロードして画面に表示しようとしていますが、私が直面している問題はアクティビティ画面にありますコンテンツビューを設定し、image.Followingはコードです:アンドロイドでイメージを表示する
main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
アクティビティ画面:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.);---->Here i cant set as main
Bitmap bitmap = DownloadImage(
"http://www.allindiaflorist.com/imgs/arrangemen4.jpg");
ImageView img = (ImageView) findViewById(R.id.); //here i cant set the image id
img.setImageBitmap(bitmap);
}
どのようなチュートリアルですか?私は、このURL http://oolopj.com/android-smart-image-view/ –