I have a textView
with OnClick
method to navigate another activity. But, If i pressed that text it doesn't navigate. But If i used Button
instead TextView
, it works perfectly. Can't use OnClick
method in TextView
?
My XML Code;
<TextView
android:onClick="webClick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
android:layout_marginLeft="17dp"
android:layout_marginTop="19dp"
android:text="Chapter 1"
android:textSize="25dp" />
My Java Code:
public void webClick(View v) {
Intent intent = new Intent(this, Webview.class);
startActivity(intent);
}