Displaying keyword search results 1 - 6
Created by Fang on November 10, 2011 20:33:46 Last update: November 10, 2011 20:33:46
The stack trace is like this:
java.lang.IllegalArgumentException: Component prop...You get this error because you are using the class attribute with a JSF UI component, for which the class attribute cannot be altered. Of course you meant CSS class, not Java class! You can use the styleClass attribute instead of the class attribute. The styleClass attribute becomes the class attribute when the component is rendered. If you can add a tag handler to the UI component, you can alias class to styleClass , which will allow you to use the class attribute on the UI component:
import javax.faces.view.facelets.*; pub...
Created by Fang on November 08, 2011 14:40:57 Last update: November 08, 2011 14:40:57
This error happened when I loaded a JSF page, using Apache MyFaces. From the stack trace it looked like the XML parser failed, but in reality the runtime was not able to load the class specified in the handler-class element - a typo in the class name! That's the price you pay for wiring together components with XML! This was the stack trace:
Caused by: org.xml.sax.SAXException: Error Handlin...
Created by freyo on September 07, 2011 16:46:14 Last update: September 07, 2011 19:23:00
The Android unit test framework is based on JUnit 3 , not JUnit 4. Test cases have to extend junit.framework.TestCase or a subclass (such as android.test.InstrumentationTestCase ). Tests are identified by public methods whose name starts with test , not methods annotated with @Test (as in JUnit 4). An Android test suite is packaged as an APK, just like the application being tested. To create a test package, first you need to identify the application package it is testing. Google suggests to put the test package source in a directory named tests/ alongside the src/ directory of the main application. At runtime, Android instrumentation loads both the test package and the application under test into the same process. Therefore, the tests can invoke methods on...
Created by freyo on May 17, 2011 11:13:17 Last update: May 17, 2011 11:13:17
This is an odd-ball content provider in that it doesn't provide database records, but provides a resource as a stream. It can be used to provide media files or XML resources. Start the project with:
tools/android create project --package com.android...Create assets directory and add an XML file ( assets/demo.xml ):
<? xml version="1.0" encoding="UTF-8"?> <people...Edit the layout ( res/layout/main.xml ):
<?xml version="1.0" encoding="utf-8"?> <LinearL...Edit src/com/android/cptest/Dummy.java :
package com.android.cptest; import java.io....Add content provider ( src/com/android/cptest/XmlResource.java ):
package com.android.cptest; import java.io....Update AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?> <manifes...Add this section to the end of build.xml :
<target name="-package-resources"> <ech...Build and install:
ant installScreenshot: Remove the Dummy activity ( AndroidManifest.xml ):
<?xml version="1.0" encoding="utf-8"?> <manifes...Create a new project for...
Created by freyo on April 18, 2011 15:08:21 Last update: April 18, 2011 15:12:20
Generate android project
$ ~/android-sdk-linux_86/tools/android create proj...Create XML file res/xml/books.xml :
<?xml version="1.0"?> <catalog> <book id=...Edit layout ( res/layout/main.xml ):
<?xml version="1.0" encoding="utf-8"?> <Lin...Edit code ( src/com/android/xmlres/XMLResource.java ):
package com.android.xmlres; import java.io....Change activity label from app_name to booklist ( AndroidManifest.xml ):
<?xml version="1.0" encoding="utf-8"?> <manifes...Add value for string resource ( res/values/string.xml ):
<?xml version="1.0" encoding="utf-8"?> <resourc...Deploy and test: