onClick / onLong / onGesture 同时存在时,点击、滑动、长按屏幕的事件处理顺序

在Android开发中,如果一个Activity里面同时继承实现了 onClickListener、onLongClickListener、onGestureListener, 此时手指在点击、滑动、长按屏幕是各个事件处理的顺序是如何的呢,通过实际项目中写日志得到如下的结果:

点击松开: onDown / onShowPress(稍长会有) / onSingleTapUp /onClick
滑动松开: onDown / onScroll(多次) / onFling / onClick / onLongClick
长按松开:onDown / onShowPress / onLongClick / onLongPress
长按并滑动后松开: onDown /onShowPress / onLongClick / onScroll(多次) / onFling

知道这个顺序后,就知道如何处理各个需要的逻辑了,同时需要注意一点:在每个过程中,任何一个事件里面return true了,后面的就将不再执行,如果要同时执行多个事件,可以在每个事件内部处理完后,return false, 后面的事件就将继续进行

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
No Responses
  1. minecraft says:

    We are a group of volunteers and opening a brand new scheme in our
    community. Your website offered us with useful info to work on.
    You have done a formidable activity and our whole group will likely be thankful to you.

  2. great publish, very informative. I wonder why the opposite experts of this sector don’t notice this.
    You must proceed your writing. I am confident, you have a huge readers’ base already!

  3. fantastic publish, very informative. I’m wondering why the other specialists of this sector do not notice this.
    You should proceed your writing. I’m confident, you’ve a huge readers’ base already!

  4. Thanks in support of sharing such a pleasant idea,
    article is nice, thats why i have read it completely

  5. Coconut Oil says:

    I couldn’t refrain from commenting. Exceptionally well written!

  6. If some one wants expert view on the topic of blogging afterward
    i advise him/her to visit this weblog, Keep up the pleasant
    work.

  7. A fascinating discussion is worth comment. There’s no doubt that that you should publish
    more on this subject, it may not be a taboo matter but generally people don’t speak about these topics.

    To the next! Kind regards!!

  8. I was recommended this website by way of my cousin.
    I’m not sure whether or not this post is written by him as nobody else recognise such certain about my difficulty.
    You’re amazing! Thanks!

  9. I was recommended this website by way of my cousin.
    I’m now not sure whether this post is written by way of him
    as nobody else recognise such specified about my trouble. You are incredible!
    Thank you!

  10. Please let me know if you’re looking for a article writer for your blog.
    You have some really great articles and I think I
    would be a good asset. If you ever want to take
    some of the load off, I’d love to write some content for your blog in exchange for a link back to mine.
    Please shoot me an e-mail if interested. Thanks!

  11. It’s very effortless to find out any matter on net as compared to textbooks, as I found this piece
    of writing at this web page.

  12. Wonderful article! This is the type of info that are supposed to be shared around the web.
    Shame on the search engines for now not positioning this put up upper!
    Come on over and seek advice from my website . Thank you =)

  13. Sling TV says:

    Hello, after reading this awesome post i am too happy to share my familiarity here with mates.

  14. Hi! I know this is kinda off topic but I’d figured I’d ask.

    Would you be interested in trading links or maybe guest writing a blog post or vice-versa?
    My site addresses a lot of the same topics as yours and I believe we could greatly benefit from each other.
    If you might be interested feel free to shoot me an e-mail.

    I look forward to hearing from you! Excellent blog by the way!

  15. Sling TV says:

    When someone writes an article he/she keeps the thought of a user in his/her brain that
    how a user can understand it. So that’s why this paragraph is outstdanding.
    Thanks!

  16. Hi there, I believe your web site may be having internet browser compatibility problems.
    Whenever I take a look at your site in Safari, it looks fine but when opening in IE,
    it has some overlapping issues. I just wanted
    to give you a quick heads up! Apart from that, wonderful site!

  17. It’s remarkable to pay a quick visit this website and
    reading the views of all mates regarding this piece of writing,
    while I am also keen of getting familiarity.

  18. I couldn’t refrain from commenting. Exceptionally well written!

  19. Piece of writing writing is also a fun, if you be familiar with then you can write if not it is complicated
    to write.

  20. minecraft says:

    Hello colleagues, how is all, and what you would like to say concerning this article, in my view
    its in fact amazing in support of me.

  21. minecraft says:

    Hello to every single one, it’s really a pleasant for me to visit this website,
    it includes helpful Information.

  22. minecraft says:

    Woah! I’m really enjoying the template/theme of this website.

    It’s simple, yet effective. A lot of times it’s difficult to get that
    “perfect balance” between usability and visual appeal.
    I must say you have done a fantastic job with this. Also, the blog loads
    extremely quick for me on Safari. Excellent Blog!

  23. Hello my family member! I wish to say that this post is awesome, nice written and include approximately all
    significant infos. I’d like to look extra posts like this .

  24. minecraft says:

    Very good article. I am going through many of these issues
    as well..

  25. gamefly says:

    I believe what you said was very logical. But, what about this?
    what if you were to write a killer headline?

    I am not suggesting your content isn’t solid, however suppose you added
    something to possibly grab people’s attention? I mean onClick
    / onLong / onGesture 同时存在时,点击、滑动、长按屏幕的事件处理顺序 | 李俊麟的平凡生活 is a little plain. You could look at Yahoo’s home page and
    see how they write news titles to get people to open the links.
    You might add a related video or a related pic or two to grab readers excited about everything’ve written.
    In my opinion, it could make your posts a little bit more interesting.

  26. I visited several web sites except the audio feature for audio songs current
    at this site is truly excellent.

  27. This excellent website truly has all the info I needed concerning this subject
    and didn’t know who to ask.

  28. Thanks for one’s marvelous posting! I certainly enjoyed reading it,
    you may be a great author. I will remember to bookmark your blog and will often come
    back from now on. I want to encourage you to continue your great
    posts, have a nice evening!

  29. fantastic publish, very informative. I ponder why the other experts
    of this sector do not realize this. You should proceed your writing.
    I’m confident, you have a great readers’ base
    already!

  30. g says:

    Wonderful, what a weblog it is! This webpage provides useful information to us, keep it up.

  31. Does your blog have a contact page? I’m having problems locating
    it but, I’d like to send you an email. I’ve got some recommendations for your blog you might
    be interested in hearing. Either way, great site and I look forward to seeing it
    improve over time.

  32. Hi! I just wanted to ask if you ever have any trouble
    with hackers? My last blog (wordpress) was hacked and I ended up losing
    months of hard work due to no data backup. Do
    you have any solutions to protect against hackers?

  33. Hey, I think your site might be having browser compatibility issues.

    When I look at your website in Firefox, it looks fine but when opening in Internet
    Explorer, it has some overlapping. I just wanted to give you
    a quick heads up! Other then that, very good blog!

  34. Quality articles or reviews is the secret to be
    a focus for the users to go to see the site, that’s what this site is providing.

  35. It’s very simple to find out any matter on net as compared to textbooks,
    as I found this article at this web site.

  36. Highly energetic post, I liked that a lot. Will there be a part 2?

  37. I am not sure where you are getting your info, but great topic.
    I needs to spend some time learning more or understanding more.
    Thanks for great info I was looking for this information for
    my mission.

  38. I all the time used to study article in news papers but now as I am a user of internet therefore from now
    I am using net for articles or reviews, thanks to web.

  39. If some one wants to be updated with most recent technologies then he must be visit this website and be up to date daily.

  40. It’s very straightforward to find out any matter on web as
    compared to books, as I found this piece of writing at this web page.

  41. dating site says:

    Thanks on your marvelous posting! I genuinely enjoyed reading it,
    you may be a great author. I will be sure to bookmark your blog and may come back later on. I want to encourage you continue your
    great posts, have a nice day!

  42. Every weekend i used to pay a quick visit this web page,
    because i wish for enjoyment, as this this website conations in fact nice funny material too.

  43. JosephTiple says:

    Thanks a lot, I appreciate it!
    canadian pharmacy reviews
    canadian pharcharmy
    canada drug prices
    canadian pharmaceuticals online
    canadian pharmacy – https://www.pharmacyonline-canadian.com/

    canadian prescriptions online Ot d644224

  44. I absolutely love your blog and find most of your post’s to be just what I’m looking for.
    Does one offer guest writers to write content to suit your
    needs? I wouldn’t mind writing a post or elaborating on a lot of the subjects you
    write regarding here. Again, awesome website!

  45. I always used to study post in news papers but now as I am
    a user of internet thus from now I am using net for articles, thanks to web.

  46. When I originally commented I clicked the “Notify me when new comments are added”
    checkbox and now each time a comment is added I get several e-mails
    with the same comment. Is there any way you can remove me from that service?
    Thanks!

  47. I’m not that much of a online reader to be honest but your blogs really nice,
    keep it up! I’ll go ahead and bookmark your website to come back in the future.

    Many thanks

  48. Great blog right here! Also your site loads up fast! What web
    host are you the use of? Can I am getting your associate link in your host?
    I want my site loaded up as quickly as yours lol

  49. Marvelous, what a blog it is! This web site provides helpful information to us, keep it
    up.

  50. Hi there every one, here every one is sharing such knowledge,
    so it’s fastidious to read this website, and I used to
    pay a quick visit this webpage all the time.

  51. Nice weblog here! Additionally your site so much up very fast!
    What host are you using? Can I get your associate link in your host?
    I desire my web site loaded up as quickly as yours lol

  52. Hey! I know this is sort of off-topic but I had to ask.
    Does running a well-established website like yours take a
    massive amount work? I’m brand new to operating a blog however I do write in my
    journal everyday. I’d like to start a blog so I can easily share my personal experience and feelings online.
    Please let me know if you have any ideas or tips for brand new aspiring bloggers.

    Thankyou!

  53. Hello there, There’s no doubt that your website
    might be having web browser compatibility issues. When I look at your blog in Safari, it looks fine however when opening in Internet Explorer,
    it has some overlapping issues. I merely wanted to give you a quick heads up!
    Aside from that, excellent site!

  54. This is a topic that is close to my heart… Best wishes! Exactly
    where are your contact details though?

  55. I visit day-to-day a few sites and information sites to read articles or reviews, except this website gives quality based
    writing.

  56. This is a topic that’s near to my heart…
    Cheers! Exactly where are your contact details though?

  57. Wonderful article! This is the type of info that should be shared around the net.
    Disgrace on Google for no longer positioning this publish upper!

    Come on over and talk over with my web site . Thanks =)

  58. Please let me know if you’re looking for a article author for
    your site. You have some really good posts and I
    believe I would be a good asset. If you ever want to
    take some of the load off, I’d love to write some material for your
    blog in exchange for a link back to mine. Please send
    me an e-mail if interested. Thank you!

  59. These are really fantastic ideas in regarding blogging.
    You have touched some fastidious things here. Any way keep up wrinting.

  60. I don’t even understand how I stopped up here, however I believed
    this post was once good. I do not realize who you are however
    definitely you are going to a famous blogger in the event you are not already.
    Cheers!

  61. I blog frequently and I truly appreciate your
    content. This great article has really peaked my interest.
    I’m going to take a note of your website and keep checking
    for new details about once per week. I subscribed to your Feed as
    well.

  62. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is
    added I get three emails with the same comment.
    Is there any way you can remove people from that
    service? Cheers!

  63. I am curious to find out what blog system you’re utilizing?

    I’m experiencing some small security issues with my latest website and I
    would like to find something more safe. Do you have any solutions?

  64. I enjoy what you guys tend to be up too. This type of clever work and exposure!
    Keep up the excellent works guys I’ve included you guys to
    my own blogroll.

  65. dvbhLaura says:

    generic viagra http://genericonlineviaqra.com/ – what is viagra generic viagra cost viagra vs cialis generic viagra online

  66. Write more, thats all I have to say. Literally, it seems as though you relied on the
    video to make your point. You clearly know what youre talking about, why throw away your intelligence on just posting videos to
    your blog when you could be giving us something enlightening to
    read?

  67. gehjtyday says:

    mexican pharmacy online https://onlinepharmacysrba.com/ – canada pharmacy online walmart online pharmacy canada pharmacy online cvs pharmacy online

  68. ps4 games says:

    Oh my goodness! Incredible article dude! Thank you, However I
    am encountering troubles with your RSS. I don’t know the reason why I can’t subscribe to it.

    Is there anybody else having identical RSS issues? Anyone who knows the solution will you kindly respond?
    Thanx!!

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image