How to leave a fixed button at the end of LinearLayout via code (without using xml)?

1

I have a linearLayout, and I put it as MATCHPARENT to occupy the entire screen of the tablet, however I needed to leave a fixed button at the bottom of the screen. Does anyone know how to do this? With xml it's easy, but via Java I'm not getting it. Thank you in advance!

    
asked by anonymous 28.09.2015 / 21:56

1 answer

1

Set gravity by using setGravity(Gravity.BOTTOM) .

    
28.09.2015 / 22:04