android - TextView.setVisibility(GONE) isn't working -
i have seekbar
textview
shown above thumb when it's moving (as tooltip). also, there's edittext
below seekbar:
when i'm not moving seekbar's thumb, textview
isn't shown. appears when move thumb or change number in edittext
. want disappear when stop moving thumb, or after finish typing in edittext
.
i got disappear on stop-tracking problem sticks there if type in edittext
.
i tried:
@override public void aftertextchanged(editable arg0) { textview.setvisibility(gone); }
but doesn't seem work. when type appears, , sticks there, until move thumb.
how can disappear after finish typing?
you can try this:
edittext.addtextchangedlistener(new textwatcher() { @override public void ontextchanged(charsequence s, int start, int before, int count) { } @override public void aftertextchanged(editable str) { new handler().postdelayed(new runnable() { @override public void run() { textview.setvisibility(view.gone); } }, 500); } @override public void beforetextchanged(charsequence s, int start, int count, int after) { textview.setvisibility(view.visible); } });
you can add handler post delay of 500 ms give more proper view.
Comments
Post a Comment