When you first include LayoutParams in your code and press Cntrl + Shift + Enter to automatically import the necessary files, you will see a list of all packages. Make sure you import the correct code into your code.
import android.view.ViewGroup.LayoutParams;
source
share