I would like to create an EditText which accepts only numbers, has a maximum of 4 numbers, and is never narrower than it would be if filled with 4 numbers (does not shrink
There is an incredibly easy way to do this programmatically.
myEditText.setLayoutParams(new LinearLayout.LayoutParams(200, 50));
This would set the width to 200 and the height to 50!!
Enjoy :)