Search code examples
androidfill-parent

Android fill_parent to match_parent


What was the reason behind introducing match_parent and deprecating fill_parent since both mean the same thing. won't this change be a hindrance to backward compatibility?


Solution

  • Using match_parent instead of fill_parent will NOT make the generated APK unrunnable in older versions because in the generated APK the occurrence of match_parent's and fill_parent's will be replaced with their corresponding Constant Value, which is same in this case (both are -1), so same APK can run on older versions of Android platform as well.

    But while compiling the code if you switch to older version (version 7 or below) then you will get a compilation error (since match_parent is not defined in version 7 or below).