点击按钮后 sendUserActionEvent() mView== null

sendUserActionEvent() mView== null after clicking on button(点击按钮后 sendUserActionEvent() mView== null)
本文介绍了点击按钮后 sendUserActionEvent() mView== null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查了这个 链接,但其中提到了长点击.但我在点击自定义对话框的按钮后面临这个问题.我已经把我的代码贴在这里了.谁能帮我避免这个错误.

I have checked with this link but there its mentioned about long clicks. but I am facing this after clicking on button of custom dialog. I have pasted my code over here. can anyone help me to avoid this error.

  ibtnCancel.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Log.w("DemoDvicetracker", etConfirmPassword
                .getText().toString());
            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(
                etConfirmPassword.getWindowToken(), 0);

            passwordPopup.dismiss();

        }
        });

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:id="@+id/rel"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:background="@drawable/popup_bg" >

<TextView
    android:id="@+id/txt_enter_pwd"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal"
    android:text="@string/enter_pwd"
    android:textSize="24sp"
    android:textColor="@android:color/black" />

<EditText
    android:id="@+id/et_password"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/txt_enter_pwd"
    android:hint="@string/pwd" 
    android:background="@drawable/popup_textfeild"
    android:layout_marginTop="30dp"
    android:layout_marginLeft="15dp"
    android:layout_marginRight="15dp"
    android:inputType="textPassword"/>

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="60dip"
    android:layout_alignParentBottom="true"
    android:layout_below="@+id/et_password"
    android:gravity="bottom"
    android:orientation="horizontal" >

    <ImageButton
        android:id="@+id/ibtn_dialog_cancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:background="@drawable/popup_cancel_selector" 
        android:contentDescription="@string/cancel"/>

    <ImageButton
        android:id="@+id/ibtn_dialog_submit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="0dp"
        android:layout_weight="1"
        android:background="@drawable/popup_submit_selector" 
        android:contentDescription="@string/submit"/>
</LinearLayout>

推荐答案

这不是你代码的问题,而是S4安卓版本的问题.在 stackoverflow 上也提出了同样的问题:sendUserActionEvent() is null

this is not a problem related to your code, but related to S4 android version. Same question has been posed on stackoverflow : sendUserActionEvent() is null

所以,请忽略它;)

这篇关于点击按钮后 sendUserActionEvent() mView== null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)