Search code examples
androidandroid-layoutbackwards-compatibility

FILL_PARENT and MATCH_PARENT


Right now I am using MATCH_PARENT all throughout my app. I've decided to make the app available to Android 2.1 users but the MATCH_PARENT is not introduced till Android 2.2

How should I go about doing this if I want my app to use MATCH_PARENT when the Android version is 2.2 and above but use FILL_PARENT if it's 2.1 (or lower if I decide to open it to them later on)?


Solution

  • FILL_PARENT and MATCH_PARENT are same thing, if the version the user is having is 2.2 or higher FILL_PARENT would be replaced by MATCH_PARENT automatically. So it's better to use FILL_PARENT, to support backward compatibility.
    There was a blog on Android dev site about this, I hope you can find it, if you want to have more details on this.