I am using a spinner in my application and setting its item values via xml. I have set spinner item default color via style, I have to enable and disable my spinner as required in my application. I want to change its item color programmatically when I set its state disable. I have searched through google but could not find any solution for this.Is there anyone who has any idea about this how can I set it.I have used this link how do you set the spinner text color?, but it is giving null pointer exception.
m_spnDia = (Spinner)findViewById(R.id.spiDia);
TextView oTextView = (TextView)m_spnDia.getChildAt(0);
oTextView.setTextColor(Color.RED);