Saturday, September 15, 2012

Attributes, Methods and Events for TextView, EditText and Button

TextView: Displays text to the user and optionally allows them to edit it.

EditText: EditText is a thin veneer over TextView that configures itself to be editable.

Button: Represents a push-button widget. Push-buttons can be pressed, or clicked, by the user to perform an action. 

XML Attributes & related Methods

Attribute Name Related Method Description
android:ems setEms(int) Makes the TextView be exactly this many ems wide. An em is a unit of measurement in the field of typography, equal to the currently specified point size.
android:gravity setGravity(int) Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view. 
android:height setHeight(int) Makes the TextView be exactly this many pixels tall. 
android:hint setHint(int) Hint text to display when the text is empty. 
android:lines setLines(int) Makes the TextView be exactly this many lines tall. 
android:password setTransformationMethod(TransformationMethod) Whether the characters of the field are displayed as password dots instead of themselves. 
android:text setText(CharSequence) Text to display. 
android:textSize setTextSize(int, float) Size of the text. 
android:textStyle setTypeface(Typeface) Style (bold, italic, bolditalic) for the text. 
android:width setWidth(int) Makes the TextView be exactly this many pixels wide. 


Note: attributes and methods are common for TextView, Edit Text and Button


Void OnTextChanged (CharSequence text, int start, int lengthBefore, int lengthAfter)
This method is called when the text is changed, in case any subclasses would like to know.

Boolean onGenericMotionEvent(MotionEvent event) 
Implement this method to handle generic motion event
Event occurs after clicking on button.


  1. This comment has been removed by the author.

  2. EditText is an overlay over TextView that configures itself to be editable. It is the predefined subclass of TextView that includes rich editing capabilities.
    Android Training in chennai | Android Training|Android Training in chennai with placement | Android Training in velachery

  3. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    Data Science Training in Chennai
    Data science training in bangalore
    Data science online training
    Data science training in pune
    Data Science training in kalyan nagar
    Data Science training in OMR
    selenium training in chennai

  4. Nice tips. Very innovative... Your post shows all your effort and great experience towards your work Your Information is Great if mastered very well.
    python training in annanagar
    python training in chennai
    python training in chennai
    python training in Bangalore

  5. Well somehow I got to read lots of articles on your blog. It’s amazing how interesting it is for me to visit you very often.
    Blueprism online training

    Blue Prism Training in Pune

  6. The site was so nice, I found out about a lot of great things. I like the way you make your blog posts. Keep up the good work and may you gain success in the long run.

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs Training in btm

  7. The site was so nice, I found out about a lot of great things. I like the way you make your blog posts. Keep up the good work and may you gain success in the long run.
    devops online training

    aws online training

    data science with python online training

    data science online training

    rpa online training

  8. Hello, I read your blog occasionally, and I own a similar one, and I was just wondering if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you can advise? I get so much lately it’s driving me insane, so any assistance is very much appreciated.
    Android Training in Chennai | Best Android Training in Chennai
    Matlab Training in Chennai | Best Matlab Training in Chennai
    Best AWS Training in Chennai | AWS Training in Chennai
    Selenium Training in Chennai | Best Selenium Training in chennai
    Devops Course Training in Chennai | Best Devops Training in Chennai

  9. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    blue prism Training in Electronic City

  10. Thanks for sharing the knowledge. So useful and practical for me. I learned something new. Very well written. It was so good to read and useful to improve knowledge. If you are looking for any Big Data related information, check our Bigdata training in bangalore web page. Thanks a lot.

  11. medical care is what many people lack in the interior areas of the world. people face a lot of health issues everyday without solution. buy psychedelics online, Buy weed online, Buy alprazolam online


  12. lovely site get you purest research chemicals online and pills at cheap and in a 48 hours delivery time maximum
    buy pills online
    buy fentanyl powder online
    buy scopolamine powder online

  13. This is a very knowledge and informative blog..
    Thanks for sharing with us,
    We are again come on your website,
    Thanks and good day,
    Please visit our site,

  14. I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more.

    data science course

  15. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    Data Science Course

  16. Thank you for sharing such a nice and interesting blog with us regarding Java. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle.
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

  17. Nice tips. Very innovative... Your post shows all your effort and great experience towards your work Your Information is Great if mastered very well.
    AWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

  18. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful.

    data science interview questions

  19. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression
    data science interview questions

  20. Attend The Data Science Courses From ExcelR. Practical Data Science Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Science Courses. data science courses

  21. Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data scientist courses

  22. Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.Best data science courses in hyerabad

  23. Nice content very helpful, It has a very important point which should be noted down. All points mentioned and very well written.Keep Posting & writing such content

    AWS Online Training
    Online AWS Certification Training

    24K Monkey Classic Incense 10g
    AK-47 – X10 / PREMIUM
    Bizarro Incense
    Buy Black Mamba Incense Online
    Buy WTF Herbal Incense
    Cloud9 Mad Hatter Incense
    Crazy Monkey Incense
    k2 spray on paper
    k2 paper sheets
    Klimax Potpourri 15xxx Coconut(10g)
    Crazy Monkey Incense
    Cloud9 Mad Hatter Incense
    Buy Purple Diesel Incense Online
    Buy Pure Fire Herbal Incense Online
    Buy Kisha Cole Incense (11g) online
    Buy Mind Trip Incense Online
    Buy Platinum XXX Herbal Incense online
    buy Orange Platinum Caution 10G

  25. Thanks for sharing What an interesting site you have i really take a good look buy cocaine online and you can also take a good look at our blog too for more information buy crack cocaine online we also recommend you to take a good look at this site too they have good content buy mdma crystals online more of the site still want you to take a closer look too as they have really good content buy crystal meth online thanks for using your time to check on the link .order cocaine online

    Buy liquid incense cheap
    Buy liquid incense cheap For Sale At The Best Incense Online Shop
    K2 Spice Spray | Liquid K2 | Liquid Spice | K2 Spray for sale


    Buy cheap liquid herbal incense at your best online shop

  28. Outstanding blog appreciating your endless efforts in coming up with an extraordinary content. Which perhaps motivates the readers to feel excited in grasping the subject easily. This obviously makes every readers to thank the blogger and hope the similar creative content in future too.

    Data Analytics Course in bhilai

  29. Astounding Blog! I might want to thank for the endeavors you have made recorded as a hard copy this post. I am trusting a similar best work from you later on too. I needed to thank you for this sites! Much obliged for sharing. Extraordinary sites!
    data scientist course in hyderabad

  30. This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.
    buy crystal meth online

  31. This comment has been removed by the author.

  32. Dia herbal Tea with 21+ Natural herbs benefits shop now with

  33. You have written an excellent blog. I learned something new from your Content. Keep sharing this kind of informative blog.
    Oracle DBA Responsibilities
    DBA Activities

  34. Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such an amazing content for all the curious readers who are very keen of being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in future too.

    Data Science Course in Bhilai

  35. Now-a-days cannabis medicine are legal in India. We can use cannabis medicines in various forms such as Cannabis oil, cannabis oil capsules etc.

  36. A few studies suggest that Cannabis oil as well as other CBD products can help with symptoms of depression.


  37. Cultivation of cannabis(cannabis in india) for industrial purposes such as making industrial hemp or for horticultural use is legal in India.

  38. Really an informative blog...Thanks for sharing an informative article with us.
    French Language Course in Bangalore
    French Learning in Bangalore

  39. I want to leave a little comment to support and wish you the best of luck.we wish you the best of luck in all your blogging enedevors
    data science course fees in delhi

  40. I like this post,And I figure that they having a great time to peruse this post,they might take a decent site to make an information,thanks for sharing it to me business analytics course in kanpur

  41. Great Blog really enjoyed reading it, I will share this to my friends and this will help them in many ways, if you are looking for Web application Development Company then toiuch and get benefited

  42. Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.
    data scientist course in hyderabad

  43. Really an awesome blog and informative content. Keep sharing more bogs with us. If you want to become a data science course training, the follow the given below link.
    Data Science Course with Placements in Hyderabad

  44. Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work! digital marketing course

  45. This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post.
    data science training

  46. 360DigiTMG offers the best Data Analytics courses in the market with placement assistance. Enroll today and fast forward your career.

    Data Analytics Course in Calicut

  47. Are you worried that joining in a top-rated Data Science course will burn a hole in your pocket, fret not 360DigiTMG offers Data Science courses that are pocket friendly. Enroll now to learn more about the course and fee details.

    Data Science Training in Jodhpur

  48. This comment has been removed by the author.