title: android.widget.textview cannot be cast to android.widget.radiogroup
body: <p>I keep getting an Error and I cant seem to fix it.
  I have tried moving code and searching the internet for an answer, so far i havent found any. Please help me, i will be really thankful. By the way im a new to this so sorry if im asking a stupid question. I keep getting an Error and I cant seem to fix it.</p>
  
  <p>This is my TutorialOne Class -</p>
  
  <pre><code>package com.chicas.thebasics;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.widget.TextView;
  import android.view.Gravity;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.RadioGroup;
  import android.widget.RadioGroup.OnCheckedChangeListener;
  
  public class tutorialOne extends Activity implements OnCheckedChangeListener{
  
      public TextView textOut;
      public EditText textIn;
      public RadioGroup gravityG;
      public RadioGroup styleG;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.tutorial1);
          textOut = (TextView) findViewById(R.id.tvChange);
          textIn = (EditText) findViewById(R.id.editText1);
          gravityG = (RadioGroup) findViewById(R.id.tvGravity);
          styleG = (RadioGroup) findViewById(R.id.tvStyle);
          Button gen = (Button) findViewById(R.id.bGenerate);
          gen.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
              textOut.setText(textIn.getText());
              }
  
      });
  
  }
  
  public void onCheckedChanged(RadioGroup group, int checkedId) {
      // TODO Auto-generated method stub
  
      switch(checkedId){
      case R.id.rbLeft:
          textOut.setGravity(Gravity.LEFT);
          break;
      case R.id.rbCenter:
          textOut.setGravity(Gravity.CENTER);
          break;
      case R.id.rbRight:
      textOut.setGravity(Gravity.RIGHT);
          break;
  
      }
  
  }
  
  
  }
  </code></pre>
  
  <p>This is the Error Log</p>
  
  <pre><code>03-13 18:02:34.773: E/AndroidRuntime(677): FATAL EXCEPTION: main
  03-13 18:02:34.773: E/AndroidRuntime(677): java.lang.RuntimeException: Unable to start     activity ComponentInfo{com.chicas.thebasics/com.chicas.thebasics.tutorialOne}: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.RadioGroup
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.os.Handler.dispatchMessage(Handler.java:99)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.os.Looper.loop(Looper.java:137)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.app.ActivityThread.main(ActivityThread.java:4745)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at java.lang.reflect.Method.invokeNative(Native Method)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at java.lang.reflect.Method.invoke(Method.java:511)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at dalvik.system.NativeStart.main(Native Method)
  03-13 18:02:34.773: E/AndroidRuntime(677): Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.RadioGroup
  03-13 18:02:34.773: E/AndroidRuntime(677):  at com.chicas.thebasics.tutorialOne.onCreate(tutorialOne.java:28)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.app.Activity.performCreate(Activity.java:5008)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
  03-13 18:02:34.773: E/AndroidRuntime(677):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
  03-13 18:02:34.773: E/AndroidRuntime(677):  ... 11 more
  03-13 18:07:34.853: I/Process(677): Sending signal. PID: 677 SIG: 9
  </code></pre>
  
  <p>Now this is my tutorial1.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  
  &lt;EditText
      android:id="@+id/editText1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:ems="10"
      android:text="" &gt;
  &lt;/EditText&gt;
  
  
  &lt;LinearLayout
  android:layout_width="match_parent"
  android:weightSum="2"
  android:layout_height="wrap_content"
  android:orientation="horizontal"&gt;
  
  &lt;TextView
      android:id="@+id/tvStyle"
      android:layout_width="fill_parent"
      android:layout_weight="1"
      android:layout_height="wrap_content"
      android:text="Style" 
      android:gravity="center" 
      android:textStyle="bold"
      /&gt;
  
  &lt;TextView
      android:id="@+id/tvGravity"
      android:layout_width="fill_parent"
      android:layout_weight="1"
      android:layout_height="wrap_content"
      android:text="Gravity"
      android:gravity="center"
      android:textStyle="bold"
      /&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="horizontal" &gt;
  
  &lt;RadioGroup 
  android:id="@+id/rgStyle"
  android:orientation="vertical" 
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content" 
  android:layout_weight="1"&gt;
  
  &lt;RadioButton 
      android:id="@+id/rbNormal" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Normal" /&gt;
  
  &lt;RadioButton 
      android:id="@+id/rbItalic"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" 
      android:text="Italic" /&gt;
  
  &lt;RadioButton 
      android:id="@+id/rbBold" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Bold" /&gt;
  
  &lt;/RadioGroup&gt;
  
  &lt;RadioGroup 
  android:orientation="vertical"
  android:id="@+id/rgGravity"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1"&gt;
  
  
  &lt;RadioButton
      android:id="@+id/rbLeft"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Left" /&gt;
  
  &lt;RadioButton
      android:id="@+id/rbCenter"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Center" /&gt;
  
  &lt;RadioButton
      android:id="@+id/rbRight"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Right" /&gt;
  &lt;/RadioGroup&gt;
  
  
  
  
  &lt;/LinearLayout&gt;
  
  
  &lt;TextView
      android:id="@+id/tvChange"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textSize="25dp"
      android:text="Type in Text and press the Button Bellow" 
      android:gravity="center"/&gt;
  
  
  &lt;Button
      android:id="@+id/bGenerate"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="Generate" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>i will be grateful for any help, thank you :)</p>