I am developing a game in Android. The game is implemented in the MainActivity.java and uses Relative Layout in xml. I want to implement a pause button, which when clicked opens a pop-up window with buttons for options like "1 player","2 Player","Change skin",'Challenge Friend" etc.
1.How to create a layout at runtime with the buttons and can we destroy the layout when an option is clicked.
2.Can we get the id of the option button clicked in the dynamically created layout, to the MainActivity, so that the corresponding function can be called.
3.when dynamically creating the layout, will the values of the already existing layout be reset?
4.Is dynamically creating layout and destroying it very expensive?
I am new to android and so would really appreciate some help...Thankyou!!!