I am new to android so please bear with me. I am developing an application using android. I am using a lot of buttons which gets enabled and disabled based on the values in the database. Each time the button id is to be specified while enabling and disabling but for each button there requires a separate function. However the functionality remains the same. I thought of using macros like that of C language so that a concatenation can be done like
#define fun(str,i) str##i
so if i pass value as fun(R.id.button,12) then button with id 12 gets selected. Can macros be used or is there any other possible way to accomplish this?? Thanks in advance.