myactivity.java
public void imagedisplay()
{
itable = (TableLayout)findViewById(R.id.itable);
String chekplace=null;
Log.e("MyList Size", "Counted--->"+mylist.size());
int size=mylist.size();
s:
for(int j=0;j<mylist.size();j++)
{
trstate = new TableRow(this);
trstate.setGravity(Gravity.CENTER_HORIZONTAL);
tstate = new TextView(this);
tstate.setGravity(Gravity.CENTER);
String tempstate = mylist.get(j).get(KEY_PLACENAME).intern().toString();
tstate.setText(tempstate);
trstate.addView(tstate);
itable.addView(trstate);
chekplacename=mylist.get(j).get(KEY_PLACENAME).intern().toString();
int counter=1;
String nextplace=chekplacename;
chekplace=nextplace;
m:
while(nextplace==chekplace)
{
trimage = new TableRow(this);
trimage.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
for (int m = 1; m <= 4; m++)
{
chekplace=mylist.get(j).get(KEY_PLACENAME).intern().toString();
if(nextplace==chekplace)
{
iimage = new ImageView(this);
iimage.setPadding(2,2,2,2);
BitmapFactory.Options bmOptions;
bmOptions = new BitmapFactory.Options();
bmOptions.inSampleSize = 4;
String loadimageurl=mylist.get(j).get(KEY_PHOTOURL).intern().toString();
counter++
bm = LoadImage(loadimageurl, bmOptions);
int height=bm.getWidth();
int width=bm.getHeight();
Log.e("newheight","Before--->" +height);
Log.e("new width","Before--->"+width);
bm=resize(bm, bm.getHeight(), bm.getWidth());
height=bm.getWidth();
width=bm.getHeight();
iimage.setLayoutParams(new TableRow.LayoutParams( height, width));
iimage.setImageBitmap(bm);
trimage.addView(iimage);
}
}
itable.addView(trimage);
}
}