The solution that worked for me was to use the EditText with TextView and a flag in adater indicating edit mode enabled / disabled.
I added the TextView and the EditText in the same position in a relative layout, meaning they would be overlapping one another. The EditText will be hidden by default and TextView will be displayed. In this the item click of listview works flawlessly.
Then I assigned touch listener for TextView and onTouch I hide the textview and display the EditText and requestfocus enabling the input. Even the entire view's on click will request focus for EditText. So no item click shall be enabled.
I have a button in actionbar "Done". Once I click it I update my flag in Adapter saying "modeEdit = false" and call notifydatasetchanges.
In GetView we have check for the flag and if modeEdit = false, then display TextView.
This was only best solution I got to be working!!!
Hope this helps. Let me know if anyone is interested in the working copy of source code.
android:focusable
attribute from EditText? – Vaticandroid:focusable="true"
to EditText then theonItemClick
of ListItem dispatch to only EditText. And the Event is not passed to it Parent List Item View. – VaticEditText
is focusable, butonItemClick
for theListView
doesn't work when I click on it. – ClaspingEditText
without any focusable attribute and then add to the activityandroid:windowSoftInputMode="adjustPan"
in the manifest. This should solve the focus problems. – IneleganceListView
is inFragment
that I put inViewPager
that I am using in FragmentActivity. For this FragmentActivity inManifest
I set<activity android:name=".activities.MainTabs" android:launchMode="singleTop" android:configChanges="orientation|screenSize" android:windowSoftInputMode="adjustPan">
and when I deleted focusable attribute it didn't helped. – ClaspingsetOnTouchListener()
toEditText
and overrideonTouch()
in onTouch justreturn false
... ? And let me know what happen... – VaticEditText
and youronItemClick
is working too? – Clasping