I have created a layout that contains two buttons, Next and Previous. In between the buttons I'm generating some dynamic views. So when I first launch the application I want to disable the "Previous" button since there wont be any previous views. I also want to disable the "Next" button when there are not more views to display. Is there anyway to disable the buttons?
Android – How to disable an Android button
androidandroid-button
Related Topic
- Android – Fling gesture detection on grid layout
- Android – How to close/hide the Android soft keyboard programmatically
- Android – How to stop EditText from gaining focus at Activity startup in Android
- Android – unique Android device ID
- Android – ‘Context’ on Android
- Android – In Android, how to set margins in dp programmatically
- Java – Proper use cases for Android UserManager.isUserAGoat()
Best Answer
Did you try this?
Update: Thanks to Gwen. Almost forgot that
android:clickable
can be set in your XML layout to determine whether a button can be clickable or not.