You are wanting to get the background color of a standard android button or some custom button that you have created?
The standard android button uses a combination of a 9-patch .png image and a selector so trying to get the background color of it is probably not going to yield anything useful. If it is a custom button that you created, could you post more of the code so we can get an idea of how the class is set up? Thanks, Justin ---------------------------------------------------------------------- There are only 10 types of people in the world... Those who know binary and those who don't. ---------------------------------------------------------------------- On Tue, Nov 3, 2009 at 5:04 AM, DHSoft <shinyry...@gmail.com> wrote: > > private View BtnTxtColor; > BtnTxtColor = (View)findViewById(R.id.BtnTxt); > > > PaintDrawable paintdrawble = (PaintDrawable)BtnTxtColor.getBackground > (); <-- appear exception > int nTempColor = paintdrawble.getPaint().getColor(); > > > > exception message is ColorDrawable. > > i wanna get Background color of Button... > > -- > You received this message because you are subscribed to the Google > Groups "Android Beginners" group. > To post to this group, send email to android-beginners@googlegroups.com > To unsubscribe from this group, send email to > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en