Applications each run in their own process, and do not run in the same
process as the system process where the window manager service runs.  Thus
they all have their own independent static globals.  What you are doing
fundamentally won't work.  To have a global across the system, you'd need to
have an IPC interface to a single entity maintaining the value, and if you
do that you need to deal with all of the associated complexity: defining the
interface, implementing the threaded service for it, designing access so
that remote processes don't have to perform IPCs all the time to it, etc.

On Sat, Jan 8, 2011 at 11:11 PM, Shafaq <s.abdullah...@gmail.com> wrote:

> I'm trying to keep track of home key button hit and touch event in the
> area of interest pressed within some fixed window of time.
> For that I'm using
> public static int COUNTER_HOME =0 in View.java under frameworks/base/
> core/java/android/view/
>
> I then increment the variable in WindowManagerService.java under
> frameworks/base/services/java/com/android/server/
> View.COUNTER_HOME++
> when i acess the variable upon touch event in ViewGroup.java which is
> a subclass of View under frameworks/base/core/java/android/view
> I see the COUNTER to be 0,
> WHy is that, is the class ViewGroup reloaded everytime the control
> transfers from WindowManagerService, I dont understand it or there is
> something I'm missing?
>
> Appreciate your help
>
> Regards,
> S.Abdullah
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to