Display text at specific location

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Display text at specific location

Postby Falmarri » Tue Jan 19, 2010 2:33 am

So I'm trying to display text at the location that the user touches on the screen. If I could be guided in a way that would be possible to do this? I'm just learning this platform, but I know how touch events work, I can get the location of the touch, I can do events on touch and on release etc, but I just can't figure out how to display stuff at specific locations. I'm not very good at XML, is there a way to do that so that it will display at a dynamic location? I tried simply using System.out.prints to print " " and "\n" characters, but that doesn't show up on the screen ( I assume the android activity isn't a terminal so I can't do that.) And I've read about using Log.v command, but I don't understand how that works.

(I'm not looking for anyone to do this for me, just guide me to the right methods or maybe a tutorial about text positions. Also, I hope this is the right section for questions like this)

Thanks
Falmarri
Falmarri
Freshman
Freshman
 
Posts: 8
Joined: Tue Jan 19, 2010 2:28 am

Top

Postby nithin.warier » Tue Jan 19, 2010 1:03 pm

Create a class which extends View and implements View.OnTouchListener. In onTouch(), get the X and Y co-ordinates and call invalidate() to redraw to the new location.
smartandroidians.blogspot.com
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google [Bot] and 9 guests