How to create as many buttons as the number added within an edittext field ANDROID

How can I write a code whereby a user enters the number of buttons needed on a text field, these buttons then displays dynamically based on the number entered on the edit text field. Thanks