[android-beginners] Re: How to draw Text in a rectangle after onTouch

2010-02-19 Thread wahib
hey mithun !! buddy i am a beginner with android thing. I need your
little help. I am able to draw markers on google map. now i want to
display a rectangular popup with little text when a user taps a
marker. so can u help me how to display that rectangle. i'll be truly
thankful if you can share some sample code if you have.


regards,
wahib

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en


[android-beginners] Re: How to draw Text in a rectangle after onTouch

2010-02-19 Thread Mike
I wouldn't do anything except set a flag indicating you need to add
text in the onTouch method and invalidate what you need to redraw.

Then, in onDraw, you'll draw on the Canvas with a TextPaint.  Read up
on those classes in the documentation available on
developer.android.com for more info.

Regards,

- Mike

On Feb 9, 2:22 am, mithun  wrote:
> Below is part of the code of onTouch
>
>                         if(event.getAction() == MotionEvent.ACTION_DOWN){
>                                 for(int i = 0; i < 2; i++){
>                                         if(tiles[i].getBounds().contains(x, 
> y) == true){
>
>                                                 //Here i need to add
> text in this rectangle!
>
>                                                 break;
>                                         }
>
>                                 }
>                                 invalidate();
>                         }
>
> Thank you in advance.

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en