Thanks for the information. Not sure how I could get out of the onclicklistener so I fixed the problem but changing the image source (image with arrow, image no arrow) within the listener (based on list position value). So it works as I wanted.
On Apr 8, 12:47 pm, Mark Murphy <mmur...@commonsware.com> wrote: > intbt wrote: > > I am trying to change visibility of a button (Image). > > > However this code does not affect the image - any ideas? > > > Prevword_btn = (ImageButton) this.findViewById(R.id.prev_btn); > > Prevword_btn.setVisibility(View.INVISIBLE); > > Nextword_btn = (ImageButton) this.findViewById(R.id.next_btn); > > Nextword_btn.setVisibility(View.INVISIBLE); > > Those should work. However, they will not take effect until you leave > whatever callback you are in (e.g., onCreate() in the activity, > onClick() in a button OnClickListener). > > > Also when I try to set visibility of the Image Button in the xml > > layout file (main.xml) I get an error message from this code > > > android:visibility="1" > > > saying integers are not accepted? > > Correct. In XML, the values are "visible", "invisible", and "gone". > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---