简体   繁体   中英

android:onClick is working slow for button

XML code for going from SignUp Page to Phone verification Page:

<Button
    android:id="@+id/signup_btn"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="55dp"
    android:background="@drawable/btn"
    android:text="Sign up"
    android:onClick="toPhoneNumber"
    android:textColor="#fff"
    android:textColorLink="#CFC8C8"/>

Further Java File Code:

 public void toPhoneNumber(View view) {
    startActivity(new Intent(this,SignUp2nd.class));
}

Ayush Dubey try addonclicklistner instead on OnClick I hope this will help you. here its documentation: https://developer.android.com/reference/android/widget/Button

Example:

  button.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 // Code here executes on main thread after user presses button
             }
         });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM