ImageButton avatarButton = (ImageButton) findViewById(R.id.ImageButton_Avatar); avatarButton.setImageResource(R.drawable.avatar); strAvatarFilename = \"Image.jpg\";
You can mess with the ImageButton's scaleType properties (to fitXY for example, or cropCenter), and by setting a fixed size to LayoutPreferences (height and width) you'll be all set.