[android-developers] Re: How to use onListItemClick() while overriding dispatchTouchEvent() in ListActivity?

2008-09-23 Thread Urakagi
Days pass but I still can't find an answer. I try to trace stack, but I can't understand how the system get position parameter since the source code of SDK is not available: ListView.performItemClick(View, int, long) line: 2968 AbsListView$PerformClick.run() line: 1406 When I call

[android-developers] Re: How to use onListItemClick() while overriding dispatchTouchEvent() in ListActivity?

2008-09-22 Thread Urakagi
Oops, I'm wrong, I can't get position. Is there other ways to get position in a ListView using X and Y message in MotionEvent? On 9月22日, 上午9時24分, Urakagi [EMAIL PROTECTED] wrote: That sounds good, but I also have a problem for it. protected void onListItemClick(ListView l, View v, int

[android-developers] Re: How to use onListItemClick() while overriding dispatchTouchEvent() in ListActivity?

2008-09-21 Thread Urakagi
That sounds good, but I also have a problem for it. protected void onListItemClick(ListView l, View v, int position, long id) I know ListView, View, and position, but how can I get id? On 9月20日, 上午5時37分, Teo Hong Siang [EMAIL PROTECTED] wrote: Here's my suggestion: If your code in

[android-developers] Re: How to use onListItemClick() while overriding dispatchTouchEvent() in ListActivity?

2008-09-19 Thread hackbod
Well yes, dispatchTouchEvent() dispatching touch events through the view. If you do this: @Override public boolean dispatchTouchEvent(MotionEvent ev) { return super.dispatchTouchEvent(ev); } it will behave exactly the same as if you didn't override the method, so I'm not sure what you mean

[android-developers] Re: How to use onListItemClick() while overriding dispatchTouchEvent() in ListActivity?

2008-09-19 Thread Urakagi
Um, I want to use dispatchTouchEvent() to implement a gesture system, so I have code like this: public boolean dispatchTouchEvent(MotionEvent ev) { boolean rtn = mGesture.onTouchEvent(ev); if (ev.getAction() == MotionEvent.ACTION_UP) {

[android-developers] Re: How to use onListItemClick() while overriding dispatchTouchEvent() in ListActivity?

2008-09-19 Thread Teo Hong Siang
Here's my suggestion: If your code in dispatchTouchEvent can determine that the gesture is empty, then you can call onListItemClick() within dispatchTouchEvent. If the gesture is not empty, then do whatever you want to do. On Sep 19, 2:45 am, Urakagi [EMAIL PROTECTED] wrote: Um, I want to use