title: Using TextView's onClick to go to the next page
body: <p>For a better UI, I thought of using TextViews in place of Buttons. When a TextView is clicked, the next page of the application should appear. I have defined onClick functions in the XML file, but it's not working.</p>
  
  <p>Here is the XML file.</p>
  
  <pre><code>&lt;TextView
      android:id="@+id/textView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="16dp"
      android:onClick="serve"
      android:text="@string/Service"
      android:textSize="20dp" /&gt;
  
  &lt;TextView
      android:id="@+id/textView2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/textView1"
      android:layout_below="@+id/textView1"
      android:layout_marginTop="87dp"
      android:onClick="complain"
      android:text="@string/Comp"
      android:textSize="20dp" /&gt;
  
  &lt;TextView
      android:id="@+id/textView3"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/textView2"
      android:layout_below="@+id/textView2"
      android:layout_marginTop="121dp"
      android:onClick="feed"
      android:text="@string/Feedback"
      android:textSize="20dp" /&gt;
  </code></pre>
  
  <p>Java file:</p>
  
  <pre><code>public class MainActivity extends Activity {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.activity_main, menu);
          return true;
      }
  
      public void serve(View v)
      {
          Intent i=new Intent();
          i.setClass(this,Second.class);
          startActivity(i);
      }
  
      public void complain(View v)
      {
          Intent in=new Intent();
          in.setClass(this,Third.class);
          startActivity(in);
      }
  
      public void feed(View v)
      {
          Intent inn=new Intent();
          inn.setClass(this,Fourth.class);
          startActivity(inn);
      }
  }
  </code></pre>