Hi,
I am developing android application and developing UI thru code rather
than XML.

The first screen or activity has a image on top which is used for mode
selection.

 -----------------------------
| ModeA | ModeB | ModeC |
 -----------------------------

I have 3 images to select from
1.      Only ModeA highlighted
2.      Only ModeB highlighted
3.      Only ModeC highlighted
So depending on the selected mode, I change the images. You can think
same as tab change.

I have made a class [ModeSwitchView extends ImageView] which holds
this image, and I create object of ModeSwitchView in the activity.
Depending on the x,y in OnTouchEvent of this View, I change the
images. Till here its fine.

Now I want to change the body of the screen depending on the mode
selected. I want to send event from View to activity that Mode has
changed and pass the current mode to it. When ModeB is selected then I
have to show 2 text boxes etc. I have tried deriving my activity from
OnTouchListener and ModeSwitchViewObj.setOnTouchListener(this) in the
activity class, but then I get touch events first in Activity and then
ModeSwitchView class.

Please let me know if there is some better method for doing this
communication [from View to Activity]. I want to avoid direct Activity
method invocation from ModeSwitchView.

thanks
sam

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