-1

I'm making an app that speeds up or slows down scrolling in Android and need a way to know what's currently on the screen of the user. As in, the app needs to know what is being displayed on the user's screen at that moment. Is there any way to do this? Thanks in advance.

  • Your question isn't clear. Please add some code – AndyFaizan Mar 13 '14 at 06:39
  • have you tried anything? Please show us your effort. – DroidDev Mar 13 '14 at 06:42
  • I think you want to ask what is currently being displayed in `scrollview` on screen. But, this is just a guess. Please make your post clear and elaborate your condition to make it understandable. Help us to help you. – DroidDev Mar 13 '14 at 06:52
  • Sorry, I should have said that I had hired a dev who is making an app FOR me. Which is maybe why my language wasn't clear as I don't know Android terminology too well. I apologize. The dev is stumped on (in his own words) how to get the app to get the "current view which is in front of the user." – user3143392 Mar 13 '14 at 07:02
  • First of all, if you don't know Android terminology, how will you be accepting the answers which are correct? Secondly, I think your developer not you should be the one asking this question. – DroidDev Mar 13 '14 at 07:19
  • I won't. I was going to link it to my dev so he that he can figure it out. I was only trying to assist him. – user3143392 Mar 13 '14 at 07:50
  • [this](http://stackoverflow.com/a/20865942/2389078) is what you are looking for, you just need to put it in your scrollview. – DroidDev Mar 13 '14 at 08:11

1 Answers1

0

if you mean currently displayed on screen ==> "Activity"

you can use this:

  ActivityManager am1 = (ActivityManager) thisActivity
                    .getSystemService(Activity.ACTIVITY_SERVICE);
 //get current activity
            String packageName = am1.getRunningTasks(1).get(0).topActivity
                    .getPackageName();
Rethinavel
  • 3,912
  • 7
  • 28
  • 49
Mohammad Rababah
  • 1,730
  • 4
  • 17
  • 32