android - OnClicking 3 EditText it makes other EditText focusable? -
i have app contains 4 edittext using textinputedittext. problem when delete values edittext number 4 , hide keyboard edittext number 3 gets focusable.
code:
if (m_firstnameedittext.gettext().hashcode() == s.hashcode()) { m_mainlayout.getviewtreeobserver().addongloballayoutlistener(new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { int heightdiff = m_mainlayout.getrootview().getheight() - m_mainlayout.getheight(); if (!(heightdiff > rewardutil.dptopx(mcontext, 200))) { // if more 200 dp, it's keyboard... m_firstnameedittext.clearfocus(); } } }); } else if (m_lastnameedittext.gettext().hashcode() == s.hashcode()) { m_mainlayout.getviewtreeobserver().addongloballayoutlistener(new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { int heightdiff = m_mainlayout.getrootview().getheight() - m_mainlayout.getheight(); if (!(heightdiff > rewardutil.dptopx(mcontext, 200))) { // if more 200 dp, it's keyboard... m_lastnameedittext.clearfocus(); } } }); } else if (m_dateofbirthedittext.gettext().hashcode() == s.hashcode()) { m_mainlayout.getviewtreeobserver().addongloballayoutlistener(new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { int heightdiff = m_mainlayout.getrootview().getheight() - m_mainlayout.getheight(); if (!(heightdiff > rewardutil.dptopx(mcontext, 200))) { // if more 200 dp, it's keyboard... m_dateofbirthedittext.clearfocus(); } } }); } else if (m_educationeditext.gettext().hashcode() == s.hashcode()) { m_mainlayout.getviewtreeobserver().addongloballayoutlistener(new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { int heightdiff = m_mainlayout.getrootview().getheight() - m_mainlayout.getheight(); if (!(heightdiff > rewardutil.dptopx(mcontext, 200))) { // if more 200 dp, it's keyboard... m_educationeditext.clearfocus(); } } }); }
Comments
Post a Comment