android - Make editable EditText on LongClick in ListView -


i'm trying make edittext field in listview editable on longclick on item. i've searched same topics on stackoverflow, haven't found best case.

here edittext xml listview item:

<edittext android:id="@+id/list_title_parent_item" style="@style/list_parent_title_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparenttop="true" android:inputtype="textpersonname" android:focusable="false" android:background="@android:color/transparent" android:lines="1" /> 

firstly disabled editing , shows text. longclick on item, must editable. i've tried did setting onitemlonglistener listview:

private class listviewonlongclicklistener implements onitemlongclicklistener {      @override     public boolean onitemlongclick(adapterview<?> parent, view view,                                    int position, long id) {         grouplistadapter adapter = (grouplistadapter)parent.getadapter();         adapter.settitleeditable();                  return true;     } }  public void settitleeditable() {     holder.title.setenabled(true);     holder.title.setfocusableintouchmode(true);     log.e("longclick", "!!!"); } 

but without success - edittext won't editable after long click , can't make long click on edittext area, on listview item.

but without success - edittext won't editable after long click , can't make long click on edittext area, on listview item.

in row xml layout, should set items except edittext focusable:false. allow edittext receive long press event.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -