I have a problem that when I set a layout xml file on an activity with width & height = fill_parent and set a background color as, say, grey, i do not get any background color when I start the activity. I tried creating a custom layout which extends LinearLayout and when I call onMeasure at this custom layout, i get
onMeasure: -2147483048 | -2147482761
where horizontal space requirements : -2147483048 and vertical space requirements : -2147482761
So, when I use
setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
for my custom layout, i get nothing, but when i use for example
setLayoutParams(new LayoutParams(50,
50));
then i get a rectangle
My question is, why?
EDIT: Tested on real phones and emulators
EDIT2: xml:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
EDIT3: java:
onCreate:
setContentView(new CustomAlarmLayout(this));
or
onCreate:
setContentView(R.layout.some_layout);
EDIT4: The number is equal MeasureSpec.AT_MOST
trying to set it to MeasureSpec.UNSPECIFIED doesn't change anything, the view is still not resized when onMeasure is called
EDIT5: My bad. The problem was that there was a wrap_content set on the TabWidget common area, so that is why my fill_parent wouldn't work