You should use lowercase view
in the xml for your custom layout:
<view class="com.test.www.BrushPreview" android:id="@+id/brushview"
android:layout_width="100dip" android:layout_height="100dip"
android:layout_gravity="center" />
(according to your link too), and it should work.
Otherwise it tries to create a android.view.View
instance.