Making a button appear in Android when a condition is fulfilled -


as title says i'd know best method generating button upon condition being fulfilled in code. in case, i'd clicking on particular imageview "s02" make button appear in activity.

i know can make alertdialogs appear using code this:

alertdialog alertdialog = new alertdialog.builder(this).create();             alertdialog.settitle("title");             alertdialog.setmessage("message");             alertdialog.setbutton("ok", new dialoginterface.onclicklistener() {                 public void onclick(dialoginterface dialog, int which) {                     // code code code code code  }                 });  

i tried substituting button alertdialog on first line couldn't use builder on button.

also, should create button in separate section of code make appear when condition set, or should put button's functionality in code creating button?

putting button in xml layout , making appear when needed easiest route. if isn't enough, can create button via new button(context), set parameters need, add parent layout.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -