当用户点击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>