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 9208211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:34:06+00:00 2026-06-18T00:34:06+00:00

Is there a way to understand if a user, in the home screen, is

  • 0

Is there a way to understand if a user, in the home screen, is clicking an app’s icon or simply the desktop?

During the develop of a live wallpaper, i overridden the onTouchEvent function

@Override
    public void onTouchEvent(MotionEvent event) {
        int action = event.getAction();
        float currentXPosition = event.getX();
        float currentYPosition = event.getY();
        Log.d(Constants.TAG_DISPLAY, "Action = " + action);
        Log.d(Constants.TAG_DISPLAY, "X = " + currentXPosition + "Y = " + currentYPosition);

        if (action == MotionEvent.ACTION_UP) {
            Log.d(Constants.TAG_DISPLAY, "FIRE Action, drawframe");
            pos[0] = Math.round(currentXPosition) + 150;
            pos[1] = Math.round(currentYPosition) - 50;
            drawFrame(true, true);
        }
        super.onTouchEvent(event);
    }

in order to refresh the wallpaper. But I don’t want to refresh it if the user is opening an application. From event or the super action, it’s possible to determine the user action?

  • 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-18T00:34:07+00:00Added an answer on June 18, 2026 at 12:34 am

    I found a workaround to understand if a user open an app. Just the open process, not bring to foreground a background app.

    public int getTotalRunningApp(){
        ActivityManager actvityManager = (ActivityManager) this.getSystemService( ACTIVITY_SERVICE );
        List<RunningAppProcessInfo> procInfos = actvityManager.getRunningAppProcesses();
        return procInfos.size();
    }
    
    
    @Override
    public void onTouchEvent(MotionEvent event) {           
        int runApp = getTotalRunningApp();
        Log.wtf(Constants.TAG_APP, "RunningApp = " + runApp);           
        ...
        super.onTouchEvent(event);
        runApp = getTotalRunningApp();
        Log.wtf(Constants.TAG_APP, "RunningApp = " + runApp);
        ...
    }
    

    By calling getTotalRunningApp() before and after the real super.onTouchEvent we can monitorize the number of running app and understand “a little” if a user is tapping an app or just moving homescreen or doing nothing.
    It’s not working with background app.

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

Sidebar

Related Questions

Is there a way to debug CoffeeScript line-by-line? I understand that it compiles into
From what I understand there is no way of type-checking the messages send in
Is there a way to understand the previous url in django view? I mean
I read this , and I understand it, but, is there a way to
Is there a way to hide specific TFS work item types for some user
Is there any way that I can understand that my code is running with
Is there some way to know that virtual keyboard is made hidden by user
Is there any way to configure IIS or Web app to automatically open a
Is there way to get file from windows xp command prompt? I tried to
Is there way to automatically maximize the output window on hitting build and then

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.