Top "Android-layoutparams" questions

How to programmatically set the layout_align_parent_right attribute of a Button in Relative Layout?

I have a relative layout which I am creating programmatically: RelativeLayout layout = new RelativeLayout( this ); RelativeLayout.LayoutParams params = new RelativeLayout.…

android android-relativelayout android-layoutparams
Removing/Adding constraint programmatically in ConstraintLayout

I want to remove and add constraint programmatically based on some condition. Here are the screenshots: and I want to …

android android-layout android-constraintlayout android-layoutparams
Android: permission denied for window type 2038 using TYPE_APPLICATION_OVERLAY

I trying to create a view that is above other applications: WindowManager.LayoutParams paramsDirectorView = new WindowManager.LayoutParams( WindowManager.LayoutParams.WRAP_…

android android-windowmanager android-layoutparams
Unknown attribute android:layout_width, layout_height, id, gravity, layout_gravity, padding

Getting Unknown attribute error on all android tag. In layout XML, Auto suggestion is not showing all attributes (like layout_…

android android-layout android-studio android-xml android-layoutparams
Setting margin programmatically to CardView

I have a CardView in my XML layout and I need to set margins to it programmatically (This is because …

android android-layout android-cardview layoutparams android-layoutparams
UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView

I am trying to create a simple Android app and I'm getting this error: java.lang.RuntimeException: Unable to start …

android list android-activity view android-layoutparams
How to set layout_alignParentRight="false" programmatically?

How to set android:layout_alignParentRight="false" programmatically? I can set it to true by this code but I want …

android android-relativelayout android-layoutparams
Permission denied for window type 2038

I'm fixing an android app not developed by me, a few days ago the client asked me to set the …

android android-windowmanager android-layoutparams