I know LinearLayoutCompat
was realized to give us some newer methods which were added in a higher levels of android to lower levels of Android.
My problem is
LinearLayoutCompat
was added to support methods which were added in newer API levels on old ones (like dividers). If you compare the methods in LinearLayout and LinearLayoutCompat you can see that the Compat layout has all methods of the LinearLayout without any API level limitation.
This brings us back to your question: You are trying to use a method which is part of the View class (LinearLayout
inherits from the View
class). The supported methods of the View class depend on the different API levels that's why you can't use this method before API level 17 neither with the LinearLayout nor the LinearLayoutCompat.
If you want to use this method no matter what API level you're on you can use the ViewCompat class and call ViewCompat.setPaddingRelative(View view, ...)
.