File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Changing Colour on Button Click Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "Changing Colour on Button Click" Watch "Changing Colour on Button Click" New topic
Author

Changing Colour on Button Click

Sahil Reddy
Ranch Hand

Joined: Jan 24, 2011
Posts: 126
I have three things 1. EditText 2. Button1(Blue) 3. Button2(Green)

I want to change the color of the text in Edit text (which user is typing) in accordance to the button click.

I have used setTextColor(Color.BLUE) and setTextColor(Color.GREEN) in the respective onClickListener of the above Buttons.



Problem : Now the problem is when i click any of the first button it works fine. When i click another button , it changes the color of the text which has already been typed by the user. I dont want that. I want to change the color of the string from the current cursor position onwards.


Regards
 
 
subject: Changing Colour on Button Click
 
Threads others viewed
howto detect which button is click
How to change font properties, of subsection of page.
programmatic change of text item color in JLIst
change back text of button with help of Thread.sleep()
Change the color of a JTable cell on mouse click
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture