Sunday, 15 January 2012

android - popup a headerview/layout whenever keyboard showed in edittext -



android - popup a headerview/layout whenever keyboard showed in edittext -

am stuck pretty simple issue in myapp . have custom dialog has edittext , whenever softkeyboard opensup want show header/a layout on dialog layout(see image 3 textviews ). if clicks on done. hidethesoftkeyboard along header.

ettagmsg = (edittext) dialog.findviewbyid(r.id.etflytagname);

popup header

linearlayout layheader = (linearlayout)findviewbyid(r.layout.header_buttons);

you might want add together listener!

ettagmsg.setonfocuschangelistener(new view.onfocuschangelistener(){ @override public void onfocuschange(view v, boolean hasfocus) { if(v.hasfocus()){ layheader.setvisibility(view.visible); }else{ layheader.setvisibility(view.gone); //hide soft input here } } }

hope of use!

android android-softkeyboard

No comments:

Post a Comment