Here's the code:
public Object getItem(int position) {
int top, bot, left, right;
top = rgnH * position; // line 1
bot = top + rgnH - (position == getCount() - 1 ? 4 : 0); // line 2
left = rgnNbr * rgnW + (rgnNbr != 0 ? BORDER : 0); // line 3
right = (rgnNbr + 1) * rgnW + (rgnNbr == 0 || rgnNbr == maxRgn ? BORDER : 0); // line 4
rect = new Rect(left, top, right, bot);
Bitmap bitmap = bitmapDecoder.decodeRegion(rect, op);
if (inBitmap == null) {
inBitmap = bitmap;
op.inBitmap = inBitmap;
}
return Bitmap.createScaledBitmap(bitmap, finalW, finalH, true);
}
Now, my problem is that after line 2 is executed, the app skips directly to the return line. I even tried to delete line 2 so that the code executes line 3 instead, but then again, it jumps ahead to the return line after executing line 3! Please help. Thank you.