+ 1
A way to stop button function
what is the perfect way to stop button function with java??
5 Answers
+ 1
I don't exactly understand what you mean, but if you want to disable a Button in an Android-App using Java, you could do something like this:
Button button1 = (Button) findViewById(R.id.button1);
button1.setEnabled(false);
This would disable the button and stop the user from clicking it, but it would still be visible and take its place on the screen.
+ 1
i have coded tic tac toe with netbeans
but when the game finished...you can press the button and it works... so i need a way to stop pressing the buttons of the game
+ 1
I understand what you mean, you could put all buttons into a LinearLayout with id layout1 and then do this:
View layout1 = (View) findViewById(R.id.layout1);
layout1.setEnabled(false);
This should make your code working
+ 1
your welcome i just try to help the people
0
thank you sir