Wrox Programmer Forums
|
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development 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 August 4th, 2011, 01:53 PM
Registered User
 
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to run color drawable xml code page 111

I tried to run it in the main.xml file but it showed a class not found error.... do i have to put in any scope to run this code.........
 
Old August 18th, 2011, 09:30 AM
Registered User
 
Join Date: Aug 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can run it from main.xml like so:

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
	<View android:id="@+id/View01" 
	    android:background="@layout/color" 
	    android:layout_width="fill_parent" 
            android:layout_height="176dp">
	</View>
</LinearLayout>
In my case color.xml was in the layout folder, not in drawable where such things are typically put. Also the layout specification could have been set to "fill_parent" instead and taken the whole screen. This may not be the best solution. I would be interested in seeing others. Maybe I will find them later in the book.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to run code chapter 9, 10, 13 ttdevelop BOOK: Professional Android 2 Application Development 17 December 7th, 2012 05:14 PM
A solid red Drawable resource solo BOOK: Professional Android 2 Application Development 1 June 15th, 2011 09:04 PM
Unable to run code for Chapter 9 ttdevelop BOOK: Professional Android 2 Application Development 1 April 26th, 2010 06:16 AM
unable to run my project ajeetmittal General .NET 0 June 11th, 2007 05:41 AM
Beginning ASP.NET 2.0 Chapter 4 page 111 gvecino BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 7 December 2nd, 2006 01:36 PM





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