I added a button in the layout and got its link in action:
Button button1=(Button)findViewById(R.id.button1); button1.setVisiblity(View.Visible);
The program crashes with this code. How to set visibility?
What mistake? it should be View.VISIBLE(in upper case).
View.VISIBLE
If you have an exception with a null pointer at this point, perhaps because it does not find the view in your layout.
Steve,
You tried to View.VISIBLEmake sure that it VISIBLEis in all the caps.
VISIBLE
View.Visible UpperCase, :
button1.setVisibility(View.VISIBLE);
, , Acitivity.runOnUIThread(new Runnable());
Acitivity.runOnUIThread(new Runnable());
If you use C #, you can use
button1.Visibility = ViewStates.Visible;
I had the same problem initially.