Create ImageViews dynamically inside a loop
I have written this code that loads an image to in ImageView widget: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gallery); i = (ImageView)findViewById(R.id.imageView1); new get_image("https://www.google.com/images/srpr/logo4w.png") { ImageView imageView1 = new ImageView(GalleryActivity.this); ProgressDialog dialog = ProgressDialog.show(GalleryActivity.this, "", "Loading. Please wait...", true); protected void onPreExecute(){ super.onPreExecute(); } protected void onPostExecute(Boolean result) { i.setImageBitmap(bitmap);