tags:

views:

78

answers:

1

Hi,

I have set image in AbsoluteLayout but it'll not display in full screen on G1 but when i run the same application in Nexus it is working properly.

I have set setContentView(new Test(this)) in my activity class. Test is my AbsoluteLayout class.

My code looks like :

public class Test extends AbsoluteLayout {public Test(Context context) {
   super(context);
   final RelativeLayout rl = new RelativeLayout(context);
    final android.widget.RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
            LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
    rl.setLayoutParams(params);
    this.addView(rl, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,
            LayoutParams.FILL_PARENT));

    ImageView mImageView = new ImageView(context);mImageView.setImageBitmap(((DataStorage)context.getApplicationContext()).getImage());
    this.addView(mImageView);   }}

Can anyone tell me that why i am not getting full image on G1 mobile screen?

A: 

I have found the problem that i have not set

this.addView(mImageView, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

Nishant Shah