当用户点击TextInputLayout时,应用程序随机崩溃

时间:2018-07-31 19:35:52

标签: android

当用户点击EditText的{​​{1}}字段时,我收到此崩溃消息

TextInputLayout

尽管没有长按,但崩溃是随机的,我不知道要重现它的任何步骤。

这就是我添加Crashed: main at android.widget.Editor.performLongClick(Editor.java:1174) at android.widget.TextView.performLongClick(TextView.java:12717) at android.view.View.performLongClick(View.java:6954) at android.view.View$CheckForLongPress.run(View.java:26066) at android.os.Handler.handleCallback(Handler.java:789) Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Editor$InsertionPointCursorController.show()' on a null object reference at android.widget.Editor.performLongClick(Editor.java:1174) at android.widget.TextView.performLongClick(TextView.java:12717) at android.view.View.performLongClick(View.java:6954) at android.view.View$CheckForLongPress.run(View.java:26066

的方式
TextInputLayout

Java代码

    <android.support.design.widget.TextInputLayout
        android:id="@+id/input_layout_email"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginTop="16dp"
        android:hint="Email Address"
        android:theme="@style/SignUpEditTextTheme"
        app:errorTextAppearance="@style/error_appearance"
        app:layout_constraintLeft_toRightOf="@+id/ic_email"
        app:layout_constraintRight_toLeftOf="@+id/rightGuideline"
        app:layout_constraintTop_toTopOf="@+id/topGuideline">


    <EditText
        android:id="@+id/et_checkout_email"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawablePadding="10dp"
        android:inputType="textEmailAddress"
        android:maxLength="40"
        android:textColorHint="#ffffff"
        android:textSize="16sp"
        android:theme="@style/SignUpEditTextTheme"
        app:layout_constraintLeft_toLeftOf="@+id/leftGuideline"
        app:layout_constraintRight_toLeftOf="@+id/rightGuideline"
        app:layout_constraintTop_toTopOf="@+id/topGuideline" />

</android.support.design.widget.TextInputLayout>

0 个答案:

没有答案