title: Class Cast Exception Issue
body: <p>Seeing strange behavior in my android application. I have a meter and a image view in my android xml. It was working fine and just on changing the position of the widgets in my xml graphical view am getting this <code>ClassCastException.</code> Following is my XML file.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/halo"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".hello" &gt;
  
      &lt;Button
          android:id="@+id/button1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_centerHorizontal="true"
          android:text="perform" /&gt;
  
      &lt;org.codeandmagic.android.gauge.GaugeView
          android:id="@+id/gauge_view1"
          android:layout_width="130dp"
          android:layout_height="130dp"
          android:layout_alignLeft="@+id/button1"
          android:layout_alignParentTop="true"
          android:layout_weight="1" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageView1"
          android:layout_width="130dp"
          android:layout_height="130dp"
          android:layout_alignLeft="@+id/gauge_view1"
          android:layout_centerVertical="true"
          android:src="@drawable/images" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The logcat shows me the following on application crashing:</p>
  
  <pre><code>09-18 11:02:01.411: E/AndroidRuntime(21312): FATAL EXCEPTION: main
  09-18 11:02:01.411: E/AndroidRuntime(21312): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hello.hello}: java.lang.ClassCastException: android.widget.Button cannot be cast to org.codeandmagic.android.gauge.GaugeView
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2194)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at android.app.ActivityThread.access$600(ActivityThread.java:139)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at android.os.Handler.dispatchMessage(Handler.java:99)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at android.os.Looper.loop(Looper.java:154)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at android.app.ActivityThread.main(ActivityThread.java:4945)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at java.lang.reflect.Method.invokeNative(Native Method)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at java.lang.reflect.Method.invoke(Method.java:511)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  09-18 11:02:01.411: E/AndroidRuntime(21312):    at dalvik.system.NativeStart.main(Native Method)
  09-18 11:02:01.411: E/AndroidRuntime(21312): Caused by: java.lang.ClassCastException: android.widget.Button cannot be cast to org.codeandmagic.android.gauge.GaugeView
  </code></pre>
  
  <p>Can anybody please explain why is it happening in my case? and then the biggest question what's the position of widgets has to do with it??</p>