{"id":10381,"date":"2014-06-10T15:01:58","date_gmt":"2014-06-10T12:01:58","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=10381"},"modified":"2014-06-10T15:01:58","modified_gmt":"2014-06-10T12:01:58","slug":"android-textview-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/","title":{"rendered":"Android TextView Example"},"content":{"rendered":"<p>Android system provides us <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/TextView.html\" target=\"_blank\"><code>TextView<\/code><\/a>, from where we can display text into the screen. Although it contains text editing operations, the basic class does not allow editing, so <code>EditText<\/code> class is provided for this reason.<\/p>\n<p>In this example we are going to show you some commonly used <code>TextView<\/code> attributes and how to embody and handle a <code>TextView<\/code> in our Android apps.<\/p>\n<p>For this tutorial, we will use the following tools in a Windows 64-bit platform:<\/p>\n<ol>\n<li>JDK 1.7<\/li>\n<li>Eclipse 4.2 Juno<\/li>\n<li>Android SDK 4.4<\/li>\n<\/ol>\n<div class=\"tip\"><strong>Tip<\/strong><br \/>You may skip project creation and jump directly to the <a href=\"#code\"><strong>beginning of the example<\/strong><\/a> below.<\/div>\n<h2>1. Create a New Android Application Project<\/h2>\n<p>Open Eclipse IDE and go to File \u2192 New \u2192 Project \u2192 Android Application Project.<\/p>\n<p>Fill in the name of the application, the project and the package in the appropriate fields and then click Next.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj1.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj1.png\" alt=\" align=&quot;aligncenter&quot;\" width=\"519\" height=\"509\" class=\"size-full wp-image-10382\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj1.png 519w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj1-300x294.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj1-42x42.png 42w\" sizes=\"(max-width: 519px) 100vw, 519px\" \/><\/a><\/p>\n<p>In the next window, the \u201cCreate Activity\u201d option should be checked. The new created activity will be the main activity of your project. Then press Next button. <\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj2.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj2.png\" alt=\"align=&quot;center&quot;\" width=\"519\" height=\"509\" class=\"size-full wp-image-10387\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj2.png 519w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj2-300x294.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_proj2-42x42.png 42w\" sizes=\"(max-width: 519px) 100vw, 519px\" \/><\/a><\/p>\n<p>In \u201cConfigure Launcher Icon\u201d window you should choose the icon you want to have in your app. We will use the default icon of android, so click Next. <\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject3.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject3.png\" alt=\"align=&quot;center&quot;\" width=\"563\" height=\"572\" class=\"size-full wp-image-7274\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject3.png 563w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject3-295x300.png 295w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject3-42x42.png 42w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/a><\/p>\n<p>Select the \u201cBlank Activity\u201d option and press Next.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject4.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject4.png\" alt=\"align=&quot;center&quot;\" width=\"563\" height=\"572\" class=\"size-full wp-image-7275\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject4.png 563w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject4-295x300.png 295w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject4-42x42.png 42w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/a><\/p>\n<p>You have to specify a name for the new Activity and a name for the layout description of your app. The .xml file for the layout will automatically be created in the\u00a0<code>res\/layout<\/code>\u00a0folder. Finally, press Finish. <\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject5.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject5.png\" alt=\"align=&quot;center&quot;\" width=\"522\" height=\"555\" class=\"size-full wp-image-7276\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject5.png 522w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/createProject5-282x300.png 282w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/a><\/p>\n<p>Now that the project is created, you can see the final structure of the project in the image below. <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_projStr.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_projStr.png\" alt=\"align=&quot;center&quot;\" width=\"314\" height=\"585\" class=\"size-full wp-image-10390\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_projStr.png 314w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTest_projStr-161x300.png 161w\" sizes=\"(max-width: 314px) 100vw, 314px\" \/><\/a><\/p>\n<h2><span id=\"code\" \/>2. Create the layout of the Main Activity<\/h2>\n<p>In this example we are going to create a simple UI, that includes only <code>TextView<\/code> with different attributes.<\/p>\n<p>Open\u00a0<code>res\/layout\/main_activity.xml<\/code>, go to the respective xml tab and paste the following. <\/p>\n<p><em><u>main_activity.xml:<\/u><\/em><\/p>\n<pre class=\"brush:xml\">\r\n&lt;RelativeLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:paddingBottom=\"@dimen\/activity_vertical_margin\"\r\n    android:paddingLeft=\"@dimen\/activity_horizontal_margin\"\r\n    android:paddingRight=\"@dimen\/activity_horizontal_margin\"\r\n    android:paddingTop=\"@dimen\/activity_vertical_margin\"\r\n    tools:context=\".MainActivity\" &gt;\r\n\r\n    &lt;TextView\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:id=\"@+id\/text1\"\r\n        android:text=\"@string\/hello_world\"\r\n        android:textStyle=\"bold\"\r\n        android:textColor=\"#ff00ff\"\r\n        android:background=\"#00ff00\"\r\n        android:textColorHighlight=\"#000000\"\r\n        android:textIsSelectable=\"true\" \/&gt;\r\n    \r\n    &lt;TextView\r\n        android:layout_width=\"fill_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_below=\"@+id\/text1\"\r\n        android:layout_marginTop=\"10dp\"\r\n        android:paddingLeft=\"10dp\"\r\n        android:lines=\"2\"\r\n        android:id=\"@+id\/text2\"\r\n        android:clickable=\"true\"\r\n        android:text=\"Another TextView\"\r\n        android:autoLink=\"all\"\r\n        android:fontFamily=\"Arial\"\r\n        android:typeface=\"serif\"\r\n        android:textSize=\"20sp\" \/&gt;\r\n\r\n&lt;\/RelativeLayout&gt;\r\n<\/pre>\n<p>Now lets explain the code above and the specific attributes that we defined in the XML file. It is worth to mention that the respective functions exist too, so we can call them in the activity source code in order to change the characteristics of the view.<\/p>\n<ul>\n<li><code>text<\/code>: defines the text that would be displayed on the screen.<\/li>\n<li><code>textStyle<\/code>: sets the style of the text. The possible choices are bold, italic and normal.<\/li>\n<li><code>fontFamily<\/code>: specifies the font family for the text.<\/li>\n<li><code>typeFace<\/code>: as you can imagine it defines the typeface for the text. The possible values are normal, sans, serif and monospace.<\/li>\n<li><code>textSize<\/code>: defines the size of the text. It is recommended to use <code>sp<\/code> for the size.<\/li>\n<li><code>textColor<\/code>: sets the color of the text. The color has to be defined in hex encoding or as a reference to another resource.<\/li>\n<li><code>background<\/code>: sets the background color of the text. Again the color should be defined in hex encoding or as a reference to another resource.<\/li>\n<li><code>textColorHighlight<\/code>: defines the color when the text is marked as highlighted.<\/li>\n<li><code>textIsSelectable<\/code>: indicates whether the text can be selected (true) or not (false). This attribute can be used in order to allow copy-paste controls.<\/li>\n<li><code>lines<\/code>: defines the exact height of the <code>TextView<\/code> in lines.<\/li>\n<li><code>clickable<\/code>: indicates if the view reacts to click events.<\/li>\n<li><code>autoLink<\/code>: identifies the links into the text and converts them into clickable ones. The available choices are web, email, phone, map or all of them.<\/li>\n<\/ul>\n<p>Of course there are more attributes, where you can find them in the <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/TextView.html\" target=\"_blank\"><code>TextView<\/code><\/a> of the android doc. Also in this example, we used more general components such as <code>layout_width<\/code> and <code>layout_height<\/code> or <code>id<\/code>, which  uniquely identifies the respective view.<\/p>\n<p>After the declaration of the components you can imagine that the <code>text1<\/code> can be selected, copied and pasted, while the <code>text2<\/code> can be clicked.<\/p>\n<h2>3. Code the Main Activity<\/h2>\n<p>Open <code>src\/com.javacodegeeks.android.textviewtest\/MainActivity.java<\/code>\u00a0and paste the following code. <\/p>\n<p><em><u>MainActivity.java:<\/u><\/em><\/p>\n<pre class=\"brush:java\">\r\npackage com.javacodegeeks.android.textviewtest;\r\n\r\nimport android.os.Bundle;\r\nimport android.app.Activity;\r\nimport android.graphics.Color;\r\nimport android.view.View;\r\nimport android.widget.TextView;\r\nimport android.widget.Toast;\r\n\r\npublic class MainActivity extends Activity {\r\n\r\n\tprivate TextView text2;\r\n\t\r\n\t@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_main);\r\n\t\t\r\n\t\ttext2 = (TextView) findViewById(R.id.text2);\r\n\t\t\r\n\t\ttext2.setOnClickListener(new View.OnClickListener() {\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tToast.makeText(getApplicationContext(), \"Text2 was clicked\",\r\n\t\t\t\t\t\tToast.LENGTH_LONG).show();\r\n\t\t\t\ttext2.setText(\"Visit us: http:\/\/examples.javacodegeeks.com\");\r\n\r\n\t\t\t\tif(text2.getLinksClickable() == true) {\r\n\t\t\t\t\ttext2.setLinkTextColor(Color.BLUE);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t});\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>As you can see in the code above in order to handle the click on the view we should define  <code>setOnClickListener<\/code>. We can change the text by calling <code>setText()<\/code> method and we can declare the color of the links through <code>setLinkTextColor()<\/code> operation. So Android system provides us a more dynamic way of changing and handling the attributes of application views. Of course, as a prerequisite is to map the <code>TextView<\/code> with the unique id component of the XML. This can be done via <code>findViewById()<\/code> method.<\/p>\n<h2>4. Run the application<\/h2>\n<p>To run our application, right click on our project \u2192 Run as \u2192 Android Application. The AVD will appear with the app loaded.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD1.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD1.png\" alt=\"align=&quot;center&quot;\" width=\"256\" height=\"359\" class=\"size-full wp-image-10392\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD1.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD1-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><\/p>\n<p>If we want to select with a gesture the first <code>TextView<\/code> we will observe that the color of the highlighted text changes, as we expect due to the definition of <code>textColorHighlight<\/code> attribute. Also, all the possible controls appear because we set <code>textIsSelectable<\/code> to true.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD2.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD2.png\" alt=\"align=&quot;center&quot;\" width=\"256\" height=\"359\" class=\"size-full wp-image-10393\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD2.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD2-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><\/p>\n<p>Now click the second text (&#8220;Another TextView&#8221;). As you can see in the image below, the click listener will be enabled  so a <code>Toast<\/code> will appear and the text will change. In addition, notice that the link is clickable because we set <code>autoLink<\/code> component to <code>all<\/code> in XML file. Also we specified the color of the link via <code>setLinkTextColor()<\/code> method, so the link is marked as blue.<\/p>\n<p><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD3.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD3.png\" alt=\"align=&quot;center&quot;\" width=\"256\" height=\"359\" class=\"size-full wp-image-10394\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD3.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextviewTestAVD3-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><\/p>\n<h2>Download Eclipse Project<\/h2>\n<p>This was an example of TextView in Android. Download the Eclipse Project of this example: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/TextViewTest.zip\">TextViewTest.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android system provides us TextView, from where we can display text into the screen. Although it contains text editing operations, the basic class does not allow editing, so EditText class is provided for this reason. In this example we are going to show you some commonly used TextView attributes and how to embody and handle &hellip;<\/p>\n","protected":false},"author":11,"featured_media":1202,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[539],"tags":[541],"class_list":["post-10381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-textview","tag-onclicklistener-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android TextView Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Android system provides us TextView, from where we can display text into the screen. Although it contains text editing operations, the basic class does\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android TextView Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Android system provides us TextView, from where we can display text into the screen. Although it contains text editing operations, the basic class does\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-10T12:01:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Katerina Zamani\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Katerina Zamani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/\"},\"author\":{\"name\":\"Katerina Zamani\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673\"},\"headline\":\"Android TextView Example\",\"datePublished\":\"2014-06-10T12:01:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/\"},\"wordCount\":879,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"keywords\":[\"onClickListener\"],\"articleSection\":[\"TextView\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/\",\"name\":\"Android TextView Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"datePublished\":\"2014-06-10T12:01:58+00:00\",\"description\":\"Android system provides us TextView, from where we can display text into the screen. Although it contains text editing operations, the basic class does\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"core\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"widget\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"TextView\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/textview\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Android TextView Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673\",\"name\":\"Katerina Zamani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/Katerina-Zamani-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/Katerina-Zamani-96x96.jpg\",\"caption\":\"Katerina Zamani\"},\"description\":\"Katerina has graduated from the Department of Informatics and Telecommunications in National and Kapodistrian University of Athens (NKUA) and she attends MSc courses in Advanced Information Systems at the same department. Currently, her main academic interests focus on web applications, mobile development, software engineering, databases and telecommunications.\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/katerina-zamani\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android TextView Example - Java Code Geeks","description":"Android system provides us TextView, from where we can display text into the screen. Although it contains text editing operations, the basic class does","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/","og_locale":"en_US","og_type":"article","og_title":"Android TextView Example - Java Code Geeks","og_description":"Android system provides us TextView, from where we can display text into the screen. Although it contains text editing operations, the basic class does","og_url":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-06-10T12:01:58+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","type":"image\/jpeg"}],"author":"Katerina Zamani","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Katerina Zamani","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/"},"author":{"name":"Katerina Zamani","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673"},"headline":"Android TextView Example","datePublished":"2014-06-10T12:01:58+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/"},"wordCount":879,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","keywords":["onClickListener"],"articleSection":["TextView"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/","url":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/","name":"Android TextView Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","datePublished":"2014-06-10T12:01:58+00:00","description":"Android system provides us TextView, from where we can display text into the screen. Although it contains text editing operations, the basic class does","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/textview\/android-textview-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Android","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/"},{"@type":"ListItem","position":3,"name":"core","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/"},{"@type":"ListItem","position":4,"name":"widget","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/"},{"@type":"ListItem","position":5,"name":"TextView","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/textview\/"},{"@type":"ListItem","position":6,"name":"Android TextView Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673","name":"Katerina Zamani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/Katerina-Zamani-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/Katerina-Zamani-96x96.jpg","caption":"Katerina Zamani"},"description":"Katerina has graduated from the Department of Informatics and Telecommunications in National and Kapodistrian University of Athens (NKUA) and she attends MSc courses in Advanced Information Systems at the same department. Currently, her main academic interests focus on web applications, mobile development, software engineering, databases and telecommunications.","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/examples.javacodegeeks.com\/author\/katerina-zamani\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/10381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=10381"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/10381\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1202"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=10381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=10381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=10381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}