[android-developers] How to use motion events with multiple layouts

2009-08-24 Thread andr0id

Hi everyone, I'm beginning in android development, and I've stumbled
upon a problem.

My application has different layouts stored in xml files, and I use
motion events such as onFling or onSingleTapup.
These motion events seem to apply whatever layout i'm in.

My problem is simply identifying which layout i'm currently using so I
can define the appropriate action.

I guess what i'm trying to do is a bit like this:

@Override
public boolean onSingleTapUp(MotionEvent e)
{
if(using main layout)
{
//do this
}
   else if (using settings layout)
{
  // do that
}
return false;
}

Is this the right way to do things ?

Thanks for the much needed help !

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] How to use motion events with multiple layouts

2009-08-24 Thread andr0id

Hi everyone, I'm beginning in android development, and I've stumbled
upon a problem.

My application has different layouts stored in xml files, and I use
motion events such as onFling or onSingleTapup.
These motion events seem to apply whatever layout i'm in.

My problem is simply identifying which layout i'm currently using so I
can define the appropriate action.

I guess what i'm trying to do is a bit like this:

@Override
public boolean onSingleTapUp(MotionEvent e)
{
   if(using main layout)
   {
   //do this
   }
  else if (using settings layout)
   {
 // do that
   }
   return false;
}

Is this the right way to do things ?

Thanks for the much needed help !

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---