Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2
This is the forum to discuss the Wrox book Professional Android Application Development by Reto Meier; ISBN: 9780470344712
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2009, 04:07 PM
Registered User
 
Join Date: Jan 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
 
Old January 10th, 2009, 01:07 PM
Reto's Avatar
Wrox Author
Points: 287, Level: 5
Points: 287, Level: 5 Points: 287, Level: 5 Points: 287, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2008
Location: London, United Kingdom
Posts: 61
Thanks: 1
Thanked 7 Times in 6 Posts
Default

Quote:
Originally Posted by eags View Post
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
__________________
Reto Meier

Author, "Professional Android 4 Application Development", Wrox, ©2012, 2010, 2008
@retomeier




Similar Threads
Thread Thread Starter Forum Replies Last Post
change color of background meena88 C# 2005 3 December 1st, 2009 04:48 AM
Background Color matrix ArnieStewart BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 3 October 21st, 2008 01:12 AM
mdi-background color avats General .NET 1 February 28th, 2008 10:25 AM
background-color disappears harpua CSS Cascading Style Sheets 1 August 19th, 2005 04:53 PM
Get stylesheet's background color muklee Javascript How-To 2 October 31st, 2004 08:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.