I wrote this code that loads an image into an 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); dialog.dismiss(); } }.execute(); }
bu now, I want to upload some images. for this I need to dynamically create images, but I do not know how ...
I want to run my code inside a for loop:
for(int i;i<range;i++){
My main problem is to create multiple ImageViews inside the loop dynamically
source share