The mechanics of UI creation in Android development are not always the most intuitive. For that reason, Huyen Tue Dao at randomlytyping.org has written a set of tips on when to use Android's MATCH_PARENT and when to use FILL_PARENT. The short version looks like this:
- When to use MATCH_PARENT: Always
- When to use FILL_PARENT: Never
Basically, Dao argues that FILL_PARENT is a clunkier version of MATCH_PARENT used for the same purposes, but with more room for confusion, because FILL_PARENT doesn't actually do what its name implies. On top of that, FILL_PARENT is deprecated, so at some point it will no longer be supported. According to Dao, the reason both exist is a kind of ineffective attempt at clearing up developer confusing:
The Android team found that developers were misinterpreting
FILL_PARENTto mean that a
Viewwould fill the remaining space left in its parent. In fact, by specifying
Viewis requesting to be as big as its parent. Thus, (as explained by Romain Guy himself in this video at around 10:56) the constant was renamed
MATCH_PARENTto clarify its use.
If you're not persuaded, Dao gives a couple of examples complete with XML layouts and device display images to illustrate her argument. Take a look at the full article for a more complete look at the difference between FILL_PARENT and MATCH_PARENT.