There is a TextView with id=text . I need in one part of the layoutParentStart code to true , and in the other to false . If someone does not understand, then in xml this is an unmarked window)

enter image description here

    1 answer 1

    1. align parent start android programmatically

    2. en-SO

    3. Answer:

       RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)button.getLayoutParams(); params.addRule(RelativeLayout.ALIGN_PARENT_START); button.setLayoutParams(params);