使用EditText充气异常

时间:2017-09-06 16:25:11

标签: android android-edittext

我是Android的新手,我有点绝望,因为我还没有找到解决方案。我正在开发一个应用程序和我制作的任何EditText,当我点击它以显示键盘以便在其上放置一些字符串时,它工作正常,但是每当我触摸相同的EditText之后,它会崩溃发送一个使用EditText充气异常。

它发生在我的所有EditText中,如果它是一个活动或片段并不重要。我试过使用TextInputEditText,但是我遇到了同样的问题。你知道我能做什么吗?

ProfileFragment.java

public class ProfileFragment implements View.OnClickListener{

    TextInputEditText inputText;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View rootView = inflater.inflate(R.layout.fragment_profile, container, false);
        inputText = (TextInputEditText) rootView.findViewById(R.id.input_text);
        return rootView;
    } 

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

    }


    @Override
    public void onClick(View view) {

    }
}

fragment_profile.xml

<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="hostapet.alpaca.com.hostapet.fragments.navigation.ProfileFragment>

    <android.support.design.widget.TextInputEditText 
        android:id="@+id/input_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

</FrameLayout>

这里是Logcat:

09:56:53.710 32730-32730/hostapet.alpaca.com.hostapet E/InputEventReceiver: Exception dispatching input event.
09-06 09:56:53.710 32730-32730/hostapet.com.hostapet E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
09-06 09:56:53.710 32730-32730/hostapet.com.hostapet E/MessageQueue-JNI: android.view.InflateException: Binary XML file line #23: Error inflating class TextView
                                                                                at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:501)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
                                                                                at android.view.LayoutInflater.inflate(LayoutInflater.java:368)
                                                                                at com.huawei.android.hwcontrol.HwEditor$HwActionPopupWindow.initContentView(HwEditor.java:909)
                                                                                at android.widget.Editor$PinnedPopupWindow.<init>(Editor.java:2247)
                                                                                at android.widget.Editor$ActionPopupWindow.<init>(Editor.java:2930)
                                                                                at com.huawei.android.hwcontrol.HwEditor$HwActionPopupWindow.<init>(HwEditor.java:859)
                                                                                at com.huawei.android.hwcontrol.HwEditor.createActionPopupWindow(HwEditor.java:186)
                                                                                at android.widget.Editor$HandleView.showActionPopupWindow(Editor.java:3361)
                                                                                at android.widget.Editor$InsertionHandleView.show(Editor.java:3632)
                                                                                at android.widget.Editor$InsertionPointCursorController.show(Editor.java:3885)
                                                                                at android.widget.Editor.showInsertionController(Editor.java:4623)
                                                                                at com.huawei.android.hwcontrol.HwEditor.showInsertionController(HwEditor.java:212)
                                                                                at com.huawei.android.hwcontrol.HwEditor.onTouchUpEvent(HwEditor.java:203)
                                                                                at android.widget.TextView.onTouchEvent(TextView.java:8087)
                                                                                at android.view.View.dispatchTouchEvent(View.java:8287)
                                                                                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                                at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2327)
                                                                                at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1705)
                                                                                at android.app.Activity.dispatchTouchEvent(Activity.java:2797)
                                                                                at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:71)
                                                                                at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2288)
                                                                                at android.view.View.dispatchPointerEvent(View.java:8477)
                                                                                at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4281)
                                                                                at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4147)
                                                                                at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3652)
                                                                                at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3705)
                                                                                at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3671)
                                                                                at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3781)
                                                                                at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3679)
                                                                                at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3838)
                                                                                at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3652)
                                                                                at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3705)
                                                                                at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3671)
                                                                                at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3679)
                                                                                at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3652)
                                                                                at android.view.ViewRootIm
09-06 09:56:53.710 32730-32730/hostapet.com.hostapet E/AndroidRuntime: FATAL EXCEPTION: main
                                                                          Process: hostapet.alpaca.com.hostapet, PID: 32730
                                                                          android.view.InflateException: Binary XML file line #23: Error inflating class TextView
                                                                              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782)
                                                                              at android.view.LayoutInflater.inflate(LayoutInflater.java:501)
                                                                              at android.view.LayoutInflater.inflate(LayoutInflater.java:425)
                                                                              at android.view.LayoutInflater.inflate(LayoutInflater.java:368)
                                                                              at com.huawei.android.hwcontrol.HwEditor$HwActionPopupWindow.initContentView(HwEditor.java:909)
                                                                              at android.widget.Editor$PinnedPopupWindow.<init>(Editor.java:2247)
                                                                              at android.widget.Editor$ActionPopupWindow.<init>(Editor.java:2930)
                                                                              at com.huawei.android.hwcontrol.HwEditor$HwActionPopupWindow.<init>(HwEditor.java:859)
                                                                              at com.huawei.android.hwcontrol.HwEditor.createActionPopupWindow(HwEditor.java:186)
                                                                              at android.widget.Editor$HandleView.showActionPopupWindow(Editor.java:3361)
                                                                              at android.widget.Editor$InsertionHandleView.show(Editor.java:3632)
                                                                              at android.widget.Editor$InsertionPointCursorController.show(Editor.java:3885)
                                                                              at android.widget.Editor.showInsertionController(Editor.java:4623)
                                                                              at com.huawei.android.hwcontrol.HwEditor.showInsertionController(HwEditor.java:212)
                                                                              at com.huawei.android.hwcontrol.HwEditor.onTouchUpEvent(HwEditor.java:203)
                                                                              at android.widget.TextView.onTouchEvent(TextView.java:8087)
                                                                              at android.view.View.dispatchTouchEvent(View.java:8287)
                                                                              at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                              at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                              at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                              at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                              at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                              at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                              at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                              at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                              at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                              at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                              at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                              at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                              at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                              at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                              at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2324)
                                                                              at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2064)
                                                                              at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2327)
                                                                              at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1705)
                                                                              at android.app.Activity.dispatchTouchEvent(Activity.java:2797)
                                                                              at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:71)
                                                                              at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2288)
                                                                              at android.view.View.dispatchPointerEvent(View.java:8477)
                                                                              at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4281)
                                                                              at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4147)
                                                                              at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3652)
                                                                              at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3705)
                                                                              at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3671)
                                                                              at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3781)
                                                                              at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3679)
                                                                              at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3838)
                                                                              at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3652)
                                                                              at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3705)
                                                                              at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3671)
                                                                              at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3679)
                                                                            at android.view.ViewRootImpl$
09-06 09:56:53.740 32730-32730/hostapet.com.hostapet I/Process: Sending signal. PID: 32730 SIG: 9

0 个答案:

没有答案