Let's start from basics. Some basics there are 3-4 types of xml attributes for android:layout_height and android:layout_width
- an exact number (you can using units like: px , dp , sp , in or mm.
- WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding).
- FILL_PARENT,which means that the view wants to be as big as its parent (minus padding) until API Level 8.
- MATCH_PARENT which means that the view wants to be as big as its parent (minus padding) ... in API Level 8 and higher.
- FILL_PARENT and MATCH_PARENT has the same function!
- There is one difference. MATCH_PARENT is in use since API level 8 and second one FILL_PARENT was used until API level 8,but you can still use, this constant is deprecated.
this is my suggestions .
- If you planning set android:minSdkVersion to 7 and lower ,then use FILL_PARENT. If you planning set android:minSdkVersion = 8 and higher MATCH_PARENT. I using MATCH_PARENT and i am not supporting Android 2.2 and lower anymore.
- Universal solution is to use value : -1.As constant value of FILL_PARENT and MATCH_PARENT is -1. :)
See official documentation for details:
BTW. Google renamed FILL_PARENT to MATCH_PARENT as FILL_PARENT was confusing for many developers.
There is even more confusion now as readability of many examples is decreased and cause misunderstanding for beginners..