About 17,000,000 results
Open links in new tab
  1. Kotlin: How to get and set a text to TextView in Android using …

    May 21, 2017 · val text: TextView = findViewById(R.id.android_text) as TextView text.setOnClickListener { text.setText(getString(R.string.name)) } Output: I got the output but …

  2. How to create simple Android TextView and display text on it …

    Mar 13, 2014 · 8 I have created a sample project and run 'Hello Android Application' in Eclipse. I have learned that a Textview can be created in two ways, either using an XML tag or by using …

  3. Android - Set text to TextView - Stack Overflow

    Oct 18, 2013 · I'm currently learning some android for a school project and I can't figure out the way to set text dynamically to a TextView. Here is my code: protected void onCreate(Bundle …

  4. How to click or tap on a TextView text - Stack Overflow

    I know this is so easy (doh...) but I am looking for a way to run a method on tapping or clicking a TextView line of text in an Android App. I keep thinking about button listeners and anonymous …

  5. android - How to display HTML in TextView? - Stack Overflow

    Jan 22, 2010 · The best approach to use CData sections for the string in strings.xml file to get a actual display of the html content to the TextView the below code snippet will give you the fair …

  6. How do I center text horizontally and vertically in a TextView?

    Jan 11, 2009 · How do I center the text horizontally and vertically in a TextView, so that it appears exactly in the middle of the TextView in Android?

  7. android - highlight text inside a textview - Stack Overflow

    Jul 21, 2016 · 16 I have a TextView with a random background color (could be any color really). I also have a text on this Textview that need to be readable. I assume the best solution is to …

  8. How to set a TextView to display text in one line in Android

    Jan 23, 2019 · 46 I've set a TextView as the display. I want to display the operation being performed in one line, for example: 9856243187 + 2457896123 - 214583 The problem is, …

  9. How can I display formatted text in a TextView? - Stack Overflow

    Sep 2, 2017 · TextView textView = (TextView) findViewById(R.id.some); textView.setText(getString(R.string.some_text)); But it displays like normal text. The …

  10. Can I underline text in an Android layout? - Stack Overflow

    Mar 7, 2010 · I took the answer from Anthony Forloney for underlining text in code and created a subclass of TextView that handles that for you. Then you can just use the subclass in XML …