Infeasible
Status Update
Comments
ro...@gtempaccount.com <ro...@gtempaccount.com> #2
This is working as intended to support trackball/dpad navigation.
jm...@gmail.com <jm...@gmail.com> #3
Interesting point, but dpad navigation would ideally allow focus of both the list
items' focusable components and the individual list items (if there is a list click
handler). For example, first focus on the list item and on the next press down, focus
on the first focusable child view.
The current behavior of lists gives inconsistent behavior in touch mode where only
some of the list items can be selected.
items' focusable components and the individual list items (if there is a list click
handler). For example, first focus on the list item and on the next press down, focus
on the first focusable child view.
The current behavior of lists gives inconsistent behavior in touch mode where only
some of the list items can be selected.
ea...@gmail.com <ea...@gmail.com> #4
Agreed that this behavior is highly inconsistent. I also found when having this
problem that there were items that were selectable and clickable with the trackball
but that there was no way to select by tapping.
problem that there were items that were selectable and clickable with the trackball
but that there was no way to select by tapping.
s....@gmail.com <s....@gmail.com> #5
Thanks a lot for this discussion. I am out of a big mess only because of this.
dn...@gmail.com <dn...@gmail.com> #6
[Comment deleted]
ar...@gmail.com <ar...@gmail.com> #7
I am also blocked because of this issue
id...@gmail.com <id...@gmail.com> #8
The "Call Log" (Phone->Call Log) seems to be able to implement this functionality. It
lists the recent calls and has a phone icon on the right you can click to make a
call, but clicking elsewhere shows info about that call.
I've been trying to decifer com.android.contacts.RecentCallsListActivity.java in the
git source:
http://android.git.kernel.org/?p=platform/packages/apps/Contacts.git;a=blob;f=src/com/android/contacts/RecentCallsListActivity.java
It uses a ListActivity and a custom Adapter (inner class defined in
RecenCallListActivity). Also there is a subclass of ImageView involved called
DontPressWithParentImageView (really!) that looks like it tries to prevent the
call_icon from getting highlighted when the user clicks on the other part of the row.
An onClick handler is defined in the Adapter that receives the click to initiate the
phone call, and an onListItemClick handler defined in the Activity that handles the
clicking on the other part of the row.
So far my attempts to reproduce have not been successful. I can't get my onClick
handler to fire as of yet, and my DontPressImageWithParent class is receiving the
setPressed method call, but doesn't seem to be affecting any functionality.
lists the recent calls and has a phone icon on the right you can click to make a
call, but clicking elsewhere shows info about that call.
I've been trying to decifer com.android.contacts.RecentCallsListActivity.java in the
git source:
It uses a ListActivity and a custom Adapter (inner class defined in
RecenCallListActivity). Also there is a subclass of ImageView involved called
DontPressWithParentImageView (really!) that looks like it tries to prevent the
call_icon from getting highlighted when the user clicks on the other part of the row.
An onClick handler is defined in the Adapter that receives the click to initiate the
phone call, and an onListItemClick handler defined in the Activity that handles the
clicking on the other part of the row.
So far my attempts to reproduce have not been successful. I can't get my onClick
handler to fire as of yet, and my DontPressImageWithParent class is receiving the
setPressed method call, but doesn't seem to be affecting any functionality.
jm...@gmail.com <jm...@gmail.com> #9
@idigix There are solutions with very ugly code that can work around the problem. The
point is that the real problem lies in bad API design of ListView. It shouln't be
necessary to work around the problem for every application that tries to do this.
point is that the real problem lies in bad API design of ListView. It shouln't be
necessary to work around the problem for every application that tries to do this.
id...@gmail.com <id...@gmail.com> #10
@jmaa: I agree. The API is awkward and poorly documented. Seeing as the Status of
this is Declined I think we might be stuck with the work arounds for a while.
I did get mine to work now. Just needed to override the newView method in my Adapter
class and set the onClick listener from there:
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View view = super.newView(context, cursor, parent);
View callView=view.findViewById(R.id.call_icon);
callView.setOnClickListener(this);
return view;
}
Now I get the same functionality as the Call Log.
this is Declined I think we might be stuck with the work arounds for a while.
I did get mine to work now. Just needed to override the newView method in my Adapter
class and set the onClick listener from there:
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View view = super.newView(context, cursor, parent);
View callView=view.findViewById(R.id.call_icon);
callView.setOnClickListener(this);
return view;
}
Now I get the same functionality as the Call Log.
to...@gmail.com <to...@gmail.com> #11
I agree with the above. The OnClick behavior of the ListView should NOT change based
on the widgets used within an item. This has not been thoroughly thought through.
on the widgets used within an item. This has not been thoroughly thought through.
na...@gmail.com <na...@gmail.com> #12
Even after a lot of tries on this issue i conclude this to be a bug, when listview
supports onitemclicklistener then why is that not called when we used baseadapter with
it.
supports onitemclicklistener then why is that not called when we used baseadapter with
it.
su...@gmail.com <su...@gmail.com> #13
I agree that this API design is highly inconsistent and illogical. There are numerous ways to support trackball and yet keep the API consistent. If we are going to stick to this behavior of not receiving OnItemClick event if autolink TextView is included in the list, then at least it should be documented!
Being new to the Android platform, it took me an hour to first figure out what the problem was once I added autolink attribute to my TextView in a ListView, as this was the last thing one would expect. And an hour after that to figure out that it was not a bug in my code but a defect in the API!!
Being new to the Android platform, it took me an hour to first figure out what the problem was once I added autolink attribute to my TextView in a ListView, as this was the last thing one would expect. And an hour after that to figure out that it was not a bug in my code but a defect in the API!!
te...@gmail.com <te...@gmail.com> #14
[Comment deleted]
da...@gmail.com <da...@gmail.com> #15
I just got burned by having copied and pasted an EditText as a TextView in my ListView. 10 hours later, I found that the leftover inputType attribute (which appeared harmless enough) was making the ListView not clickable.
da...@gmail.com <da...@gmail.com> #16
[Comment deleted]
fe...@gmail.com <fe...@gmail.com> #17
I'm not sure if this solves all or any issues but I put
android:focusable="false" on the view that I don't want to steal the focus from my listview and in the cursoradapter's newView and bindView set the setOnCheckedChangeListener
And it works perfectly.
android:focusable="false" on the view that I don't want to steal the focus from my listview and in the cursoradapter's newView and bindView set the setOnCheckedChangeListener
And it works perfectly.
jm...@gmail.com <jm...@gmail.com> #18
@16 I did something similar at the time, but I remember there still were some problems with long press and highlights in the list. It didn't work perfectly at all.
lp...@gmail.com <lp...@gmail.com> #19
I also have a problem with this. My list items have a text view and a check box in each, and I cannot get the list items clickable at all! The checkbox is and I can select items with the dpad, but no combination of attributes or methods could make the whole list item to be clickable. That is very frustrating!
[Deleted User] <[Deleted User]> #20
I have Same problem.. any one got the solution.. ?
ab...@gmail.com <ab...@gmail.com> #21
For me, it fails when I set the InputType property for TextView. Without InputType it it works perfectly.
ra...@gmail.com <ra...@gmail.com> #22
I have a listview with a custom adapter: the first row is a header and has an edittext and four buttons as a filter, the other rows simply display various details.
The very first time I can press one of the four buttons, but then it won't work.
The edittext works even worse: I can write some text, but then backspace doesn't work unless I explicitly make another click on it and enter some more text before using backspace.
What's strange is that if I keep the software keyboard open, everything works as expected.
This doesn't make any sense!
The very first time I can press one of the four buttons, but then it won't work.
The edittext works even worse: I can write some text, but then backspace doesn't work unless I explicitly make another click on it and enter some more text before using backspace.
What's strange is that if I keep the software keyboard open, everything works as expected.
This doesn't make any sense!
ae...@gmail.com <ae...@gmail.com> #23
'This is working as intended to support trackball/dpad navigation.' I find this funny seeeing as how a vast majority of devices no longer even support dpad or touch interfacing. From HTC alone 18 of 31 phones are touch mode only, and both of their tablets as well.
[Deleted User] <[Deleted User]> #24
My workaround is to set view listeners on each row returned by my adapter's getView() method. It is important to set a new listener on each returned view whether I inflate it or Android is recycling an old one.
[Deleted User] <[Deleted User]> #25
I encountered a similar issue when adding an ImageButton, the solution was to replace it with an ImageView
rm...@gmail.com <rm...@gmail.com> #26
Why was this defect declined? If no child element accepts a click event, why would this event not be passed on?
ep...@googlemail.com <ep...@googlemail.com> #27
if you are using an ImageButton like I was, swap it for an ImageView and use the same onclick event with focusable="false" set in the layout
sk...@gmail.com <sk...@gmail.com> #28
An easy way to work around this problem is to call
"setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS);"
on the listView views as they are added.
You'll be able to select rows, click on rows and click on child checkboxes and buttons.
"setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS);"
on the listView views as they are added.
You'll be able to select rows, click on rows and click on child checkboxes and buttons.
to...@gmail.com <to...@gmail.com> #29
Thiw workaround does not work when using a TextView with inputType is set.
[Deleted User] <[Deleted User]> #30
The "setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS)" workaround above works well. Maybe it could be the default? I agree with everyone here that the current design is *very* broken as it is just about guaranteed to fail for the majority of developers who look at the API and think they are using it correctly. Unless the JavaDocs are amended with some very prominent warnings and suggestions, I think that nothing short of an API change is likely to keep them from falling into this trap.
fa...@gmail.com <fa...@gmail.com> #31
Thanks #27, of all the necessarily annoying and imperfect solutions yours is by far the most painless. And I want the last 4 hours of my life back.
ch...@gmail.com <ch...@gmail.com> #32
Also solved via #27. In fact you can add it to the layout XML (if inflated by one): android:descendantFocusability="blocksDescendants". Also want 1 hour of my life back, #30.
sh...@gmail.com <sh...@gmail.com> #33
Thanks #27 and #31, working great for me.
mi...@gmail.com <mi...@gmail.com> #34
setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS) doesn't work when you have an EditText as one of you children in a ListView item. How can I allow focus to be on the ListView item as a whole AND an EditText inside of it??
ni...@gmail.com <ni...@gmail.com> #35
I think that the bug appears when you creat and list item with an ImageButton in it.
The workaround in comment 27 solve the problem but I think that we need to fix this bug.
The workaround in comment 27 solve the problem but I think that we need to fix this bug.
ni...@gmail.com <ni...@gmail.com> #36
Also comment 26 is correct if you change the ImageButton with an ImageView it works perfect!!
oh...@gmail.com <oh...@gmail.com> #37
Thanks #27 and #31.
ma...@gmail.com <ma...@gmail.com> #38
Has anyone reopened/rereported this issue? I am pissed!
sh...@gmail.com <sh...@gmail.com> #39
None of the solutions seem to work for me. I have a Checkbox and two TextViews, and can't select the row
sh...@gmail.com <sh...@gmail.com> #40
Actually #27's solution just worked for me:
-I have a Custom ArrayAdapter and a custom layout for each row of the ListView.
-I had to put "android:descendantFocusability="blocksDescendants" in the XML of the LinearLayout of the custom layout
-I have a Custom ArrayAdapter and a custom layout for each row of the ListView.
-I had to put "android:descendantFocusability="blocksDescendants" in the XML of the LinearLayout of the custom layout
lo...@gmail.com <lo...@gmail.com> #41
android:descendantFocusability="blocksDescendants" worked perfect for me, thanks #27 and #31!
Romain guy has declined reported bugs before, pretty much telling us "you can't do that". I can't wait to finish this Android project and get back to iOS...
Romain guy has declined reported bugs before, pretty much telling us "you can't do that". I can't wait to finish this Android project and get back to iOS...
ak...@gmail.com <ak...@gmail.com> #42
Thanks a lot tony(comment 28). I was having problems because Grid view's onItemLongClick was not working. From your comment I figured out that InputType setting in a textview in the custom view was the culprit. Removed it and the code works like a charm!
et...@gmail.com <et...@gmail.com> #43
Solution of #27 seems works for me too, but when I select one item of the list, the child view of the item (in my case, a button) turns orange, like the rest of the item.
How can I fix this issue?
How can I fix this issue?
al...@gmail.com <al...@gmail.com> #44
I keep getting the below error:
E/AndroidRuntime(2297): android.content.res.Resources$NotFoundException: String resource ID #0xffffffff... try many fixes just not able to get the listview working. It display brilliantly all the imanges and textviews.. Any other thoughts guys, have been on it for a day now.. No luck...
E/AndroidRuntime(2297): android.content.res.Resources$NotFoundException: String resource ID #0xffffffff... try many fixes just not able to get the listview working. It display brilliantly all the imanges and textviews.. Any other thoughts guys, have been on it for a day now.. No luck...
pa...@gmail.com <pa...@gmail.com> #45
same problem as #33.
block descendants focus makes the whole row clickable, but then I can't insert text inside the edittext, as (obviously) it's not getting the focus.
again, do any of you guys know a way of allowing focus to be on the ListView item as a whole AND an EditText inside of it??
block descendants focus makes the whole row clickable, but then I can't insert text inside the edittext, as (obviously) it's not getting the focus.
again, do any of you guys know a way of allowing focus to be on the ListView item as a whole AND an EditText inside of it??
ca...@gmail.com <ca...@gmail.com> #46
I have a ListView with a TextView, 2 CheckBox and an EditText in its rows.
Using android:descendantFocusability="blocksDescendants" allows onListItemClick() to be called and the two CheckBox work well, but as stated above, the EditText is not editable as it has no focus.
If I remove the android:descendantFocusability="blocksDescendants", onListItemClick() is not called and the EditText does not work properly. To fix the EditText behaviour I used:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
Please, do not decline this bugs and try to fix it!
Using android:descendantFocusability="blocksDescendants" allows onListItemClick() to be called and the two CheckBox work well, but as stated above, the EditText is not editable as it has no focus.
If I remove the android:descendantFocusability="blocksDescendants", onListItemClick() is not called and the EditText does not work properly. To fix the EditText behaviour I used:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
Please, do not decline this bugs and try to fix it!
oc...@gmail.com <oc...@gmail.com> #47
How can this be declined? At least provide some clarity ...
ad...@gmail.com <ad...@gmail.com> #48
FIX THIS PLZ!!!!
er...@gmail.com <er...@gmail.com> #49
Thanks #27 and #31 saved lot of time :).
al...@gmail.com <al...@gmail.com> #50
I have TextView's (with HTML data in them) inside ListView, some of them still not receive click event.
android:descendantFocusability="blocksDescendants" helped partially.
android:descendantFocusability="blocksDescendants" helped partially.
jo...@kalderstam.se <jo...@kalderstam.se> #51
android:descendantFocusability="blocksDescendants" allows the row to be selected, however it still looks like shite because every item in the layout receives the pressed event, making all buttons contained in the list item to "light up" as if clicked when in fact they are not clicked.
The solution to override the view's (button) setPressed method works in a normal listview but not for widgets where only the standard buttons can be used.
I consider this to be broken, since for the system to support d-pads all developers are forced to do weird workarounds to support touch screens and in the process break said d-pad support...
The solution to override the view's (button) setPressed method works in a normal listview but not for widgets where only the standard buttons can be used.
I consider this to be broken, since for the system to support d-pads all developers are forced to do weird workarounds to support touch screens and in the process break said d-pad support...
ia...@gmail.com <ia...@gmail.com> #52
I have a ListView that is part of my Activity. This ListView contains a list of check boxes.
I want to prevent the user from editing the checkbox unless the Activity is in edit mode. I have a button on the activity that will put the form into edit mode. The button then diapears and a cancel button is provided so the user can cancel edit mode. If the user makes a change to a check box i want to then provide a new button to save the data in my db.
I cannot seem to fathom how this is possible. I have tried several methods for this but cannot seem to get a suitable format for this, any ideas how i could achive this?
I have posted more details of the problem at the following link:
http://stackoverflow.com/questions/10817089/android-lock-checkboxes-when-not-in-edit-mode-in-custom-array-adapter
Please help
I want to prevent the user from editing the checkbox unless the Activity is in edit mode. I have a button on the activity that will put the form into edit mode. The button then diapears and a cancel button is provided so the user can cancel edit mode. If the user makes a change to a check box i want to then provide a new button to save the data in my db.
I cannot seem to fathom how this is possible. I have tried several methods for this but cannot seem to get a suitable format for this, any ideas how i could achive this?
I have posted more details of the problem at the following link:
Please help
to...@tonyfendall.com <to...@tonyfendall.com> #53
It's a bit of hack, but I found a possible solution using an onTouchListener rather than an onClickListner.
If a onTouchListener is added to the list item View itself when it is created then this will trigger whenever the user touches the list item, but does not fire when the user touches a EditText view within the list item.
The only major drawback of this approach is that the list row doesn't flash orange (focus color) when it is touched (although it might be possible to trigger this manually).
If a onTouchListener is added to the list item View itself when it is created then this will trigger whenever the user touches the list item, but does not fire when the user touches a EditText view within the list item.
The only major drawback of this approach is that the list row doesn't flash orange (focus color) when it is touched (although it might be possible to trigger this manually).
ax...@gmail.com <ax...@gmail.com> #54
Thanks for the solution of #27 it works perfectly if any item of the list is set focusable=true by xml or java or has it by default. All items must have focusable=false in order to work.
j1...@gmail.com <j1...@gmail.com> #55
#27 Thank you very much for the solution, works as a charm!, after all this time trying to get it to work, finally could understand what It was all about!
jn...@gmail.com <jn...@gmail.com> #56
It is possible to resend the onListItemClick call back to the fragment/activity if an event is not consumed by listeners in the custom adapter. At the point where it is identified that the subview is not handling the event call: fragment.onListItemClick(fragment.getListView(), v, position, 0); (This assumes you have passed the activity/fragment reference to the adapter constructor.)
ad...@gmail.com <ad...@gmail.com> #57
Thanks everyone. The android:descendantFocusability="blocksDescendants" saved me. I set it up in the LinearLayout declaration of the XML element that is being displayed and I can now click on it to perform an action or use the side checkbox for other actions.
Thanks again.
Thanks again.
ro...@gmail.com <ro...@gmail.com> #58
+1 for android:descendantFocusability="blocksDescendants" as the default
hp...@gmail.com <hp...@gmail.com> #59
"android:descendantFocusability="blocksDescendants""
It also helped me, with custom layout it must be added in the custom item .xml....
It also helped me, with custom layout it must be added in the custom item .xml....
ep...@gmail.com <ep...@gmail.com> #60
thank you guys...
"android:descendantFocusability="blocksDescendants" on the list item's view helped me as well..
Google team: please mention that in the official API docs... PLEASE! one usually want to have a button inside a listview.
"android:descendantFocusability="blocksDescendants" on the list item's view helped me as well..
Google team: please mention that in the official API docs... PLEASE! one usually want to have a button inside a listview.
ta...@gmail.com <ta...@gmail.com> #61
i don't say know
qa...@gmail.com <qa...@gmail.com> #62
How to apply the given patch on an android project????
qa...@gmail.com <qa...@gmail.com> #63
I am having the same problem since two days. I extremely need help as i have to submit my project in few days. I have tried the above solutions but nothing seams working...
you can see my code on the following link.
http://stackoverflow.com/questions/15887655/onclicklistner-for-button-in-listactivity-header-is-not-working
I have also attached xml-layout image for more info
Any kind of help is really appreciated...
Thank you
you can see my code on the following link.
I have also attached xml-layout image for more info
Any kind of help is really appreciated...
Thank you
du...@gmail.com <du...@gmail.com> #64
I can't get it working, i tried everything :|
as...@gmail.com <as...@gmail.com> #65
I have very much same problem as #50 . This is not working even with fragments. i have fragment with two image buttons on which selector for image on buttons are set. I have set onclicklistener on the fragment .problem is when i click the area between the two buttons on the fragment , my buttons light up as it goes to pressed state and selector loads the bright image.i am expecting nothing to happen.
Tried all the above given solutions but nothing is working. pretty much stuck with this.Additionally,Also tried android:duplicateParentState="false" on buttons but no result. Somebody please help.
Tried all the above given solutions but nothing is working. pretty much stuck with this.Additionally,Also tried android:duplicateParentState="false" on buttons but no result. Somebody please help.
[Deleted User] <[Deleted User]> #66
It would be good to see this reconsidered.
The Settings application makes use of toggle switches and tappable list view items. By trying to follow this pattern you run into this issue pretty quickly.
The other issue is that there are heaps of "answers" on Stackoverflow; which are just plain incorrect because they break support for devices without touch-screens.
Even if this behaviour doesn't change, I'd be happy with the existing behaviour if the Android dev team could provide some examples of how to implement
The Settings application makes use of toggle switches and tappable list view items. By trying to follow this pattern you run into this issue pretty quickly.
The other issue is that there are heaps of "answers" on Stackoverflow; which are just plain incorrect because they break support for devices without touch-screens.
Even if this behaviour doesn't change, I'd be happy with the existing behaviour if the Android dev team could provide some examples of how to implement
il...@gmail.com <il...@gmail.com> #67
"android:descendantFocusability="blocksDescendants" works to some extent: if your textview takes most of the space of ListView item, and say only part of the text is a link (linkified by android:autoLink="all") then there is very little space left to get the row click through.
For those who having same problem there is a good workaround on SO
http://stackoverflow.com/questions/7236840/android-textview-linkify-intercepts-with-parent-view-gestures/7327332#7327332
For those who having same problem there is a good workaround on SO
ep...@gmail.com <ep...@gmail.com> #68
another approach I take is more convenient imho, supporting complex content and tested on API 10 and higher is:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:onClick="YOUR_CLICK_HANDLE"
android:background="@android:drawable/btn_default"
android:id="@+id/complexButtonLayout"
>
..
complex contents
...
</LinearLayout>
You can either use via handle ( your activity hosting the view implements public void YOUR_CLICK_HANDLE(View view); method ) or you register onclick handler programmatically.
however, I use the views in Fragments.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:onClick="YOUR_CLICK_HANDLE"
android:background="@android:drawable/btn_default"
android:id="@+id/complexButtonLayout"
>
..
complex contents
...
</LinearLayout>
You can either use via handle ( your activity hosting the view implements public void YOUR_CLICK_HANDLE(View view); method ) or you register onclick handler programmatically.
however, I use the views in Fragments.
ha...@digitech.cz <ha...@digitech.cz> #69
5 years on, and this gigantic bug is still inside Android OS. Tells a lot about closed sourced SW (and this *is* closed sources OS).
sc...@learnovatelabs.com <sc...@learnovatelabs.com> #70
[Comment deleted]
sc...@learnovatelabs.com <sc...@learnovatelabs.com> #71
This is absolutely unacceptable. Fix it instead of being lazy please, There is no reason why a developer shouldn't be allowed to easily place EditText inside a row without rewriting your SDK from scratch.
If this will help those who come here later, I set it up so EditText worked normally, then did this horrible hack on nearby views to force the correct behavior:
older.timeView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
ListView lv = (ListView) parent;
int pos = lv.getPositionForView(v);
lv.performItemClick(lv.getAdapter().getView(pos, null, null), pos, pos);
return true;
}
});
Also, I had to pop my backstack in my implementation, not sure why, not going to bother right now. Hope this helps someone
If this will help those who come here later, I set it up so EditText worked normally, then did this horrible hack on nearby views to force the correct behavior:
older.timeView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
ListView lv = (ListView) parent;
int pos = lv.getPositionForView(v);
lv.performItemClick(lv.getAdapter().getView(pos, null, null), pos, pos);
return true;
}
});
Also, I had to pop my backstack in my implementation, not sure why, not going to bother right now. Hope this helps someone
xi...@gmail.com <xi...@gmail.com> #72
android:descendantFocusability="blocksDescendants"
works for me.
Thanks.
my condation:
listview item with textView contains autoLink="alll"
works for me.
Thanks.
my condation:
listview item with textView contains autoLink="alll"
xe...@gmail.com <xe...@gmail.com> #73
Why was this declined? I also had to go the blocksDescendants root, wtf.
[Deleted User] <[Deleted User]> #74
What I found so annoying is that "listView" by it's very nature want's to be clicked so you can start another activity. What do you do, drop a listView widget in your layout, populate it with your resource and then "look at it".?
The XML Android:Clickable="True/False" makes no sense because listView's want to be clicked. That's what they were designed to do. listView's clickable XML Properties are inadequate. You should not have to go to MainActivity.java and "onItemClick" anything to get listView to respond to a click event unless your customizing something.
I just spent the last 16 day's trying to get my listView to respond to click events using code samples from every blog under the sun, and nothing worked. Android:Clickable="True/False" should be recoded to act like a button widget by using Android:Clickable="array_resource_name" so like a button widget, you would construct your Intent's in MainActivity.java like you would with a button, except the recode would read your array resource in your RES/VALUES file, and auto-construct the .java below.
example,
listView XML
android:clickable="array_resource_name"
MainActivity.java
public void "array_resource_name" (View view) {
"array_item_name_01" Intent intent = new Intent (this, activity.class);
"array_item_name_02" Intent intent = new Intent (this, activity.class);
"array_item_name_03" Intent intent = new Intent (this, activity.class);
"array_item_name_04" Intent intent = new Intent (this, activity.class);
startActivities(intent);
}
The XML Android:Clickable="True/False" makes no sense because listView's want to be clicked. That's what they were designed to do. listView's clickable XML Properties are inadequate. You should not have to go to MainActivity.java and "onItemClick" anything to get listView to respond to a click event unless your customizing something.
I just spent the last 16 day's trying to get my listView to respond to click events using code samples from every blog under the sun, and nothing worked. Android:Clickable="True/False" should be recoded to act like a button widget by using Android:Clickable="array_resource_name" so like a button widget, you would construct your Intent's in MainActivity.java like you would with a button, except the recode would read your array resource in your RES/VALUES file, and auto-construct the .java below.
example,
listView XML
android:clickable="array_resource_name"
MainActivity.java
public void "array_resource_name" (View view) {
"array_item_name_01" Intent intent = new Intent (this, activity.class);
"array_item_name_02" Intent intent = new Intent (this, activity.class);
"array_item_name_03" Intent intent = new Intent (this, activity.class);
"array_item_name_04" Intent intent = new Intent (this, activity.class);
startActivities(intent);
}
li...@gmail.com <li...@gmail.com> #75
My issue was resolved like this:
When deal with click event in list item, call list.performItemClick, so ListView can receive OnItemClick
For example:
public boolean performClick() {
if (condition) {
list.performItemClick()
} else {
default
}
}
When deal with click event in list item, call list.performItemClick, so ListView can receive OnItemClick
For example:
public boolean performClick() {
if (condition) {
list.performItemClick()
} else {
default
}
}
Description
that list item click events will never be received for list items with
views that can either handle click events or can gain focus.
Expected would be that the clickable or focusable views would receive the
touch events for the area of the screen covered by the view. Other touch
events that are inside a list item, but not on a clickable or focusable
view, should be handled by the list and result in a list item click event.
Also, a TextView with links should only handle the touch events on the
links, but not touch events on other areas of the text. (This is: the
behavior of a TextView without links should be mirrored for the non-link
part of the text.)
Attached is a simple test Activity to demonstrate the current behavior of
Android. Also, a suggested fix is attached in the form of a patch file. The
same test activity can be used to verify correct functioning of Android
with the fix, but make sure to set the flag described in the next paragraph
after the fix is applied.
The fix currently only works if the application has set
TextView.sTouchFixEnabled=true, but ideally the fix should be enabled for
applications that are built for a version of Android with this fix or later.