0

i am a completely new user to Android Studios so pardon me. I'm here to find out how to create an intent to start a new activity, from a clickable Textview.

<TextView
    android:id="@+id/textView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentEnd="true"
    android:layout_marginBottom="283dp"
    android:layout_marginEnd="46dp"
    android:clickable="true"
    android:onClick="forgotPassword"
    android:text="Forgot your password?"
    android:textColor="#F0D9B3"
    android:textSize="12sp"
    android:textStyle="italic" />

^ here's my Textview code and the activity i want to transition to is the ForgotPassword.class, how do i go about writing the intent code?

  • 2
    Possible duplicate of [What is an Intent in Android?](https://stackoverflow.com/questions/6578051/what-is-an-intent-in-android) – vikas kumar Jul 02 '18 at 18:08

1 Answers1

0

Try this:

void forgotPassword(View view) {
    Intent in = new Intent(this, ForgotPassword.class);
    startActivity(in);

}
jkdev
  • 11,360
  • 15
  • 54
  • 77
Raj
  • 2,997
  • 2
  • 12
  • 30