Android EditText with text password input type doesn't select all character by double tap -


i'm trying use edittext textpassword input type. faced situation in characters entering in field selected double tap in android version 5 , 4.4 while feature didn't work on android version 6. please me have feature in android versions?

this xml file:

<?xml version="1.0" encoding="utf-8"?> <linearlayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">       <edittext         android:hint="text password input type"         android:inputtype="textpassword"         android:layout_width="match_parent"         android:layout_height="wrap_content" /> </linearlayout> 

this result:

enter image description here

the general algorithm be:

private long timelastclicked; private static final time_double_click_ms = 1000; private edittext passwordfield;  //should put result of findviewbyid in here  ...  myedittext.setonclicklistener(new onclicklistener() {     public void onclick(view view) {         long time = system.currenttimemillis();         if(time - timelastclicked < time_double_click_ms) {            passwordfield.setselection(0,passwordfield.gettext().length());         }         timelastclicked = time; }); 

what does- sets click listener. when see click, check if saw click in previous second. if so, hilight text. if not, don't. either way, save time of click can compare next time.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -