D
D
DanielPo2022-03-08 15:48:22
Java
DanielPo, 2022-03-08 15:48:22

How to create new buttons?

I need to create a new button from java and style it, how can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Prokhorovich, 2022-03-09
@alexgp13

For example, like this:
https://stackoverflow.com/questions/11710200/andro...

Button btnAddARoom = new Button(this);
    btnAddARoom.setText("Add");
    btnAddARoom.setLayoutParams(params);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question