Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7756511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:50:33+00:00 2026-06-01T12:50:33+00:00

I have implemented Shake Event listener in my application and onShake do some logic.

  • 0

I have implemented Shake Event listener in my application and onShake do some logic. I want to show a dialog after the user has stopped shaking the phone. Where do I need to implement this logic? If I do it onShake itself then multiple dialogs will appear. Can someone help me?

Thanks
Jai

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:50:35+00:00Added an answer on June 1, 2026 at 12:50 pm

    so, thinking about your problem, i was initially considering to “tweak” the constant values of your listener (MIN_FORCE, MIN_TIME… etc) in order to create some “resistance” for the event, so it wouldn’t be fired excessively. Then i realized it was a stupid idea, since there is a much better solution… just unbind the event handler when the shake event occurs, and then re-bind it when the user dismisses the dialog. To do this, use the same code provided in the answer you used for the onResume and onPause methods:

    this to bind the listener:

        mSensorManager.registerListener(mSensorListener,
        mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
        SensorManager.SENSOR_DELAY_UI);
    

    and this to unbind it:

    mSensorManager.unregisterListener(mSensorListener);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have implemented the - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { to capture the shake when
I have implemented a simple file upload-download mechanism. When a user clicks a file
HI, I have a view that has three UIScrollViews on the screen. I want
I have implemented a function to validate .edu domains. This is how I am
I have implemented basic syntax highlighting by properly setting the NSTextStorage delegate of my
I have implemented arbitrary links in my rtb using the CodeProject found here .
I have implemented an ASP.NET http handler. It appears to me that there is
I have implemented what I thought was a pretty decent representation of MVC in
I have implemented a python webserver. Each http request spawns a new thread. I
I have implemented a SAX parser in Java by extending the default handler. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.