![](/img/trans.png)
[英]how to intent to another activity by making clickable TextView in drawable navigation
[英]How do i make an intent to go to another activity from a clickable Textview?(Android Studios)
我是Android Studios的全新用户,请原谅。 我在这里了解如何从可单击的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" />
^这是我的Textview代码,我想过渡到的活动是ForgotPassword.class,我该如何编写意图代码?
尝试这个:
void forgotPassword(View view) {
Intent in = new Intent(this, ForgotPassword.class);
startActivity(in);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.