p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 (http://p2p.wrox.com/forumdisplay.php?f=432)
-   -   Chapter 4 Compass background color (http://p2p.wrox.com/showthread.php?t=72168)

eags January 9th, 2009 04:07 PM

Chapter 4 Compass background color
 
Is this a typo or is there something I'm not understanding about why we don't use r.getColor here? It works fine without but produces a different background color and I'm guessing we're just getting lucky since the reference and the color value we expect are both integers.

Quote:

circlePaint.setColor(r.getColor(R.color.background _color));
//circlePaint.setColor(R.color.background_color);
Later when using setColor for the text and marker Paint objects we do use r.getColor.

Thanks.

Reto January 10th, 2009 01:07 PM

Quote:

Originally Posted by eags (Post 232855)
I'm guessing we're just getting lucky since the reference and the color value we expect are both integers.

You're exactly right. There's a typo there that should read (as you suggest):
Code:

circlePaint.setColor(r.getColor(R.color.background_color));
Thanks for pointing it out, hope it didn't slow you down much [:o]


All times are GMT -4. The time now is 04:17 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.