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

  • SEARCH
  • Home
  • 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 7546263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:09:14+00:00 2026-05-30T09:09:14+00:00

I have some problems with OnTouchListener . I want that everytime when user touch

  • 0

I have some problems with OnTouchListener. I want that everytime when user touch the screen to go to a certain activity. The problem is that when I touch the screen it is making something like an refresh for the present activity and it starts (the current activity contains a ViewFlipper and when the screen is touched the viewflipper starts flipping from the begining). Only at the second touch the app goes to next activity. Can anyone help me to solve this?

My current activity extends OnTouchListener , I set myviewflipper.setonTouchListener(this) and my onTouch() method is :

@Override
    public boolean onTouch(View v, MotionEvent event) {
            finish=true;
        Intent intent = new Intent(getBaseContext(), FinishApplication.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
        return true;
    }

After I touch the screen is called onPause() and onResume(). On onResume() method I start some timers for some updates (when updates are made, the slideshow starts) and I think that’s the reason why my activity is refresh. I set a variable boolean finish to true only after the screen is touch and start the updates only if finish is false but is not working. My variable is not set to true. Any other idea how can I solve this ?

@Override
    protected void onResume() {
        super.onResume();
        System.out.println("OnResume ViewPlaylist!!");
        t = new Timer();
        t.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                runOnUiThread(new Runnable() {
                    public void run() {
                        Imalive();
                    }
                });

            }

        }, 300, 30000);

        if (finish != true) {
            System.out.println("Start update!");
            update = new Timer();
            update.scheduleAtFixedRate(new TimerTask() {

                @Override
                public void run() {
                    runOnUiThread(new Runnable() {
                        public void run() {
                            updateItems();
                        }
                    });
                }

            }, 30000, 20000);
        } else {
            finish = true;
            Intent intent = new Intent(SlideShow.this, FinishApplication.class);
            intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intent);
            finish();


}
}
  • 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-05-30T09:09:15+00:00Added an answer on May 30, 2026 at 9:09 am

    I solve this by calling finish() on onPause() method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problems with making my web-app adapted for remote user browseres language
i want to use .animate function but i have some problems i want to
I have some problems with ASP.NET page cycle. I want to fire event when
I have some problems using Code Igniter and I feel there is something I
I hope this is a simple problem. I have a seekbar that I want
I have some problems with this code? Here is my code that creates text
I have some problems with authorization. I don't want to use Spring Security, just
I have some problems with Extjs4 librairie. I want to use treeEditor component. Firebug
I have some problems with new version of Spring. I am doing something wrong
I have some problems with an rpm spec file that is listing the same

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.