{"id":10732,"date":"2014-06-23T13:30:03","date_gmt":"2014-06-23T10:30:03","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=10732"},"modified":"2019-05-09T11:12:04","modified_gmt":"2019-05-09T08:12:04","slug":"android-edittext-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/","title":{"rendered":"Android EditText Example"},"content":{"rendered":"<p>Android system supports <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/EditText.html\" target=\"_blank\" rel=\"noopener noreferrer\"><code>EditText<\/code><\/a>, which is a subclass of <code>TextView<\/code> supplied with text editing operations. We often use <code>EditText<\/code> in our Android applications in order to provide an input or text field, especially in forms.<\/p>\n<p>In this example we are going to show you some commonly used <code>EditText<\/code> xml attributes and how to embody and handle an <code>EditText<\/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 \/>\nYou may skip project creation and jump directly to the <a href=\"#code\"><strong>beginning of the example<\/strong><\/a> below.<\/div>\n<\/p>\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><figure id=\"attachment_10734\" aria-describedby=\"caption-attachment-10734\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj1.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj1.png\" alt=\"Figure 1. Create a new Android application\" width=\"510\" height=\"510\" class=\"size-full wp-image-10734\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj1.png 510w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj1-150x150.png 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj1-300x300.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj1-200x200.png 200w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj1-100x100.png 100w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj1-42x42.png 42w\" sizes=\"(max-width: 510px) 100vw, 510px\" \/><\/a><figcaption id=\"caption-attachment-10734\" class=\"wp-caption-text\">Figure 1. Create a new Android application<\/figcaption><\/figure><\/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><figure id=\"attachment_10735\" aria-describedby=\"caption-attachment-10735\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj2.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj2.png\" alt=\"Figure 2. Configure the project\" width=\"510\" height=\"510\" class=\"size-full wp-image-10735\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj2.png 510w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj2-150x150.png 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj2-300x300.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj2-200x200.png 200w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj2-100x100.png 100w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_proj2-42x42.png 42w\" sizes=\"(max-width: 510px) 100vw, 510px\" \/><\/a><figcaption id=\"caption-attachment-10735\" class=\"wp-caption-text\">Figure 2. Configure the project<\/figcaption><\/figure><\/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 button.<\/p>\n<p><figure id=\"attachment_6805\" aria-describedby=\"caption-attachment-6805\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project3.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project3.png\" alt=\"Figure 3. Configure the launcher icon\" width=\"660\" height=\"591\" class=\"size-full wp-image-6805\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project3.png 660w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project3-300x268.png 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><figcaption id=\"caption-attachment-6805\" class=\"wp-caption-text\">Figure 3. Configure the launcher icon<\/figcaption><\/figure><\/p>\n<p>Select the \u201cBlank Activity\u201d option and press Next.<\/p>\n<p><figure id=\"attachment_6806\" aria-describedby=\"caption-attachment-6806\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project4.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project4.png\" alt=\"Figure 4. Create the activity and select its type\" width=\"660\" height=\"591\" class=\"size-full wp-image-6806\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project4.png 660w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project4-300x268.png 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><figcaption id=\"caption-attachment-6806\" class=\"wp-caption-text\">Figure 4. Create the activity and select its type<\/figcaption><\/figure><\/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&nbsp;<code>res\/layout<\/code>&nbsp;folder. Finally, press Finish.<\/p>\n<p><figure id=\"attachment_6807\" aria-describedby=\"caption-attachment-6807\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project5.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project5.png\" alt=\"Figure 5. Create a new blank activity\" width=\"660\" height=\"591\" class=\"size-full wp-image-6807\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project5.png 660w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2013\/11\/create_new_project5-300x268.png 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><figcaption id=\"caption-attachment-6807\" class=\"wp-caption-text\">Figure 5. Create a new blank activity<\/figcaption><\/figure><\/p>\n<p>Now you can see the final structure of the project in the following image.<\/p>\n<p><figure id=\"attachment_10736\" aria-describedby=\"caption-attachment-10736\" style=\"width: 314px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_projStr.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_projStr.png\" alt=\"Figure 6. The final structure of the project\" width=\"314\" height=\"585\" class=\"size-full wp-image-10736\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_projStr.png 314w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_projStr-161x300.png 161w\" sizes=\"(max-width: 314px) 100vw, 314px\" \/><\/a><figcaption id=\"caption-attachment-10736\" class=\"wp-caption-text\">Figure 6. The final structure of the project<\/figcaption><\/figure><\/p>\n<h2><span id=\"code\">2. Create the layout of the Main Activity<\/span><\/h2>\n<p>In this example we are going to add some <code>EditTexts<\/code> where each one includes different attributes. Also we will create two buttons in order to show how we can transfer the values of <code>EditText<\/code> in other activities or display them on the screen.<\/p>\n<p>Open&nbsp;<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\">&lt;RelativeLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingBottom=\"@dimen\/activity_vertical_margin\"\n    android:paddingLeft=\"@dimen\/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen\/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen\/activity_vertical_margin\"\n    tools:context=\".MainActivity\" &gt;\n\n    &lt;EditText \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"50dp\"\n        android:id=\"@+id\/editInp\"\n        android:hint=\"@string\/hello_world\"\n        android:singleLine=\"true\"\n        android:inputType=\"textCapWords\"\/&gt;\n    \n    &lt;EditText \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"50dp\"\n        android:layout_below=\"@+id\/editInp\"\n        android:hint=\"Numbers from 1-5\"\n        android:background=\"#ff00ff\"\n        android:id=\"@+id\/editDig\"\n        android:digits=\"12345\" \/&gt;\n    \n    &lt;EditText \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"50dp\"\n        android:layout_below=\"@+id\/editDig\"\n        android:id=\"@+id\/editPass\"\n        android:hint=\"Password\"\n        android:password=\"true\" \/&gt;\n    \n    &lt;EditText \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"50dp\"\n        android:layout_below=\"@+id\/editPass\"\n        android:id=\"@+id\/editPhone\"\n        android:inputType=\"phone\"\n        android:maxLength=\"10\"\n        android:clickable=\"true\"\n        android:hint=\"Phone\" \/&gt;\n    \n    &lt;Button\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"50dp\"\n        android:layout_below=\"@+id\/editPhone\"\n        android:id=\"@+id\/nextBtn\"\n        android:text=\"Next\" \/&gt;\n    \n    &lt;Button\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"50dp\"\n        android:layout_below=\"@+id\/nextBtn\"\n        android:id=\"@+id\/displayBtn\"\n        android:text=\"Display\" \/&gt;\n\n&lt;\/RelativeLayout&gt;\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 there are the respective functions too, where we can call in the activity source code in order to change the characteristics of the view. Also all the attributes and methods of <code>TextView<\/code> can be used, due to subclass inheritance.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul>\n<li><code>hint<\/code>: defines the hint text that would be displayed in the edit text. The text can be defined directly or as a reference to <code>values\/strings.xml<\/code> resource.<\/li>\n<li><code>singleLine<\/code>: sets whether the text is appeared in one line (true) or if it is wrapped into multiple ones (false).<\/li>\n<li><code>maxLength<\/code>: specifies the maximum number of characters that the user could put into the text field.<\/li>\n<li><code>digits<\/code>: specifies the specific numbers that are accepted to be used.<\/li>\n<li><code>inputType<\/code>: declares the type of data that the user can fill in the text field. Some of the possible choices are textCapWords, email, phone etc, so the input in the text field is adjusted respectively. For multiple than one choices we should use <code>|<\/code> character for separation.<\/li>\n<li><code>password<\/code>: indicates that the input is going to be a password, so the text is hidden to the user. Another way to do this, is to set the attribute <code>inputType<\/code> into <code>textPassword<\/code>.<\/li>\n<\/ul>\n<p>As we mentioned we can use the components of <code>TextView<\/code>, where some of them are defined to our example:<\/p>\n<ul>\n<li><code>background<\/code>: sets the background color of the edit text. Again the color should be defined in hex encoding or as a reference to another resource.<\/li>\n<li><code>clickable<\/code>: indicates if the view reacts to click events.<\/li>\n<\/ul>\n<p>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 attributes, you can imagine the text format that is accepted in each input field.<\/p>\n<h2>3. Code the Main Activity<\/h2>\n<p>Open <code>src\/com.javacodegeeks.android.textviewtest\/MainActivity.java<\/code>&nbsp;and paste the following code.<\/p>\n<p><em><u>MainActivity.java:<\/u><\/em><\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.edittexttest;\n\nimport android.os.Bundle;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.Toast;\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.graphics.Color;\n\npublic class MainActivity extends Activity {\n\n\tprivate EditText input, digits, pass, phone;\n\tprivate Button next, display;\n\tprivate Context context;\n\t\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n\t\t\n\t\tcontext = this.getApplicationContext();\n\t\t\n\t\tinput = (EditText) findViewById(R.id.editInp);\n\t\tdigits = (EditText) findViewById(R.id.editDig);\n\t\tpass = (EditText) findViewById(R.id.editPass);\n\t\tphone = (EditText) findViewById(R.id.editPhone);\n\t\t\n\t\tphone.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tToast msg = Toast.makeText(getBaseContext(), \"Only 10 numbers\",\n\t\t\t\t\t\tToast.LENGTH_LONG);\n\t\t\t\tmsg.show();\n\t\t\t}\n\t\t});\n\t\t\n\t\tnext = (Button) findViewById(R.id.nextBtn);\n\t\t\t\t\n\t\tnext.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\n\t\t\t\tIntent myIntent = new Intent(context, NextScreen.class);\n\t\t\t\tmyIntent.putExtra(\"pass\", pass.getText().toString());\n\t\t\t\tmyIntent.putExtra(\"phone\", phone.getText().toString());\n\t\t\t\tstartActivity(myIntent);\n\t\t\t}\n\t\t});\n\t\t\n\t\tdisplay = (Button) findViewById(R.id.displayBtn);\n\t\t\n\t\tdisplay.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tinput.setTextColor(Color.RED);\n\t\t\t\tString displayString = \"You typed '\" + input.getText().toString() +\n\t\t\t\t\t\t\"' as input text and '\" + digits.getText().toString() + \"' as digits\";\n\t\t\t\t\n\t\t\t\tToast msg = Toast.makeText(getBaseContext(), displayString,\n\t\t\t\t\t\tToast.LENGTH_LONG);\n\t\t\t\tmsg.show();\n\t\t\t}\n\t\t});\n\t}\n\n}\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>. Notice that we use the <code>OnClickListener<\/code> not only to the <code>Buttons<\/code> but to an <code>EditText<\/code> too. That is happening because we set the <code>clickable<\/code> attribute to true for the specific <code>EditText<\/code> (<code>phone<\/code>). When this <code>EditText<\/code> is clicked a message is appeared to remind us of the maximum input length.<\/p>\n<p>Also in this example we want to show you how to transfer the values of the <code>EditTexts<\/code> to another <code>Activity<\/code> as well as how to handle them in the existing one. When <code>next<\/code> button is clicked, a new <code>Intent<\/code> is created, including the values of two <code>EditTexts<\/code> that the user filled in. Notice that <code>getText()<\/code> and <code>toString()<\/code> methods are called in order to take the string representation of these values. In addition, when <code>display<\/code> button is clicked a <code>Toast<\/code> is appeared on the screen and <code>setTextColor()<\/code> function is called in order to change the  text color of the specific <code>EditText<\/code>. At this point, it is important to mention that 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 every view with the unique id component of the XML. This can be done via <code>findViewById()<\/code> method.<\/p>\n<h2>4. Code the Intent Activity<\/h2>\n<p>Now we are going to create a simple <code>Activity<\/code> for the <code>Intent<\/code> that we declared in the <code>MainActivity.java<\/code>.<\/p>\n<p>Go to the package of the project, then right click on it \u2192 New \u2192 Class. Specify the name of the class, as you can see in the image below, and press Finish.<\/p>\n<p><figure id=\"attachment_10737\" aria-describedby=\"caption-attachment-10737\" style=\"width: 543px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_NextScreen.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_NextScreen.png\" alt=\"Figure 7. Create a new class (NextScreen)\" width=\"543\" height=\"629\" class=\"size-full wp-image-10737\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_NextScreen.png 543w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_NextScreen-258x300.png 258w\" sizes=\"(max-width: 543px) 100vw, 543px\" \/><\/a><figcaption id=\"caption-attachment-10737\" class=\"wp-caption-text\">Figure 7. Create a new class (NextScreen)<\/figcaption><\/figure>[ulp id=&#8217;XSQzgZ7lDbTb31Tj&#8217;]<\/p>\n<p>Notice that the name is the same as the intent&#8217;s class name at the <code>MainActivity.java<\/code>.<\/p>\n<p>Now open <code>src\/com.javacodegeeks.android.textviewtest\/NextScreen.java<\/code>&nbsp;and paste the following code.<\/p>\n<p><em><u>NextScreen.java:<\/u><\/em><\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.edittexttest;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.widget.TextView;\n\npublic class NextScreen extends Activity{\n\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.next_activity);\n\t\t\n\t\t\/\/ receive the arguments from the previous Activity\n\t\tBundle extras = getIntent().getExtras();\n\t\tif (extras == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\/\/ assign the values to string-arguments\n\t\tString pass = extras.getString(\"pass\");\n\t\tString phone = extras.getString(\"phone\");\n\t\t\n\t\tTextView passText = (TextView) findViewById(R.id.passText);\t\t\n\t\tpassText.setText(pass);\t\n\t\t\n\t\tTextView phoneText = (TextView) findViewById(R.id.phoneText);\t\t\n\t\tphoneText.setText(phone);\t\n\t}\n\t\n}\n<\/pre>\n<p>Although the explanation of this code is outside the scope of the specific example, we want to mention a few things. After we receive the arguments from the previous <code>Activity<\/code> via <code>Intent<\/code>, we assign them to new arguments and we display them through <code>TextViews<\/code> by calling <code>setText()<\/code> operation.<\/p>\n<h2>5. Create the layout of the Intent Activity<\/h2>\n<p>At this point we should create a xml file that represents the layout of the <code>NextScreen.java<\/code> activity. We are going to define two simple <code>TextViews<\/code> in order to show the <code>EditText<\/code> values on the screen.<\/p>\n<p>Go to <code>res\/layout<\/code> then right click on it \u2192 New \u2192 Android XML File. Give the name <code>next_activity<\/code>, choose <code>LinearLayout<\/code> as root element and press Finish.<\/p>\n<p><figure id=\"attachment_10738\" aria-describedby=\"caption-attachment-10738\" style=\"width: 475px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_next_activity.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_next_activity.png\" alt=\"Figure 8. Create an XML Android file (next_activity)\" width=\"475\" height=\"491\" class=\"size-full wp-image-10738\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_next_activity.png 475w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_next_activity-290x300.png 290w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_next_activity-42x42.png 42w\" sizes=\"(max-width: 475px) 100vw, 475px\" \/><\/a><figcaption id=\"caption-attachment-10738\" class=\"wp-caption-text\">Figure 8. Create an XML Android file (next_activity)<\/figcaption><\/figure><\/p>\n<p>Now open <code>res\/layout\/next_activity.xml<\/code> and go to the respective xml tab. Finally paste the code below.<\/p>\n<p><em><u>next_activity.xml:<\/u><\/em><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" &gt;\n    \n    &lt;TextView \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id\/passText\"\n        android:layout_marginBottom=\"10dp\" \/&gt;\n    \n    &lt;TextView \n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id\/phoneText\" \/&gt;\n\n&lt;\/LinearLayout&gt;\n<\/pre>\n<h2>6. Define the new Activity<\/h2>\n<p>We have to define the <code>NextScreen<\/code> activity in our <code>AndroidManifest.xml<\/code> file. In our occasion, we want <code>NextScreen<\/code> to leads us back to the&nbsp;<code>MainActivity<\/code>, so we will define the&nbsp;<code>MainActivity<\/code>&nbsp;as it\u2019s parent&nbsp;<code>Activity<\/code>. For this reason <code>parentActivityName<\/code>&nbsp;android element is used.<\/p>\n<p>Open <code>AndroidManifest.xml<\/code> file and choose the xml tab. Then paste the following code.<\/p>\n<p><em><u>AndroidManifest.xml:<\/u><\/em><\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;manifest xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    package=\"com.javacodegeeks.android.edittexttest\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\" &gt;\n\n    &lt;uses-sdk\n        android:minSdkVersion=\"8\"\n        android:targetSdkVersion=\"18\" \/&gt;\n\n    &lt;application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable\/ic_launcher\"\n        android:label=\"@string\/app_name\"\n        android:theme=\"@style\/AppTheme\" &gt;\n        &lt;activity\n            android:name=\"com.javacodegeeks.android.edittexttest.MainActivity\"\n            android:label=\"@string\/app_name\" &gt;\n            &lt;intent-filter&gt;\n                &lt;action android:name=\"android.intent.action.MAIN\" \/&gt;\n\n                &lt;category android:name=\"android.intent.category.LAUNCHER\" \/&gt;\n            &lt;\/intent-filter&gt;\n        &lt;\/activity&gt;\n        \n        &lt;activity\n\t        android:name=\"com.javacodegeeks.android.edittexttest.NextScreen\"\n\t        android:label=\"@string\/app_name\"\n\t        android:parentActivityName=\"com.javacodegeeks.android.edittexttest.MainActivity\" &gt;\n    \t&lt;\/activity&gt;\n    &lt;\/application&gt;\n\n&lt;\/manifest&gt;\n<\/pre>\n<h2>7. 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><figure id=\"attachment_10739\" aria-describedby=\"caption-attachment-10739\" style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD1.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD1.png\" alt=\"Figure 9: The Android app is loaded\" width=\"256\" height=\"359\" class=\"size-full wp-image-10739\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD1.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD1-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><figcaption id=\"caption-attachment-10739\" class=\"wp-caption-text\">Figure 9: The Android app is loaded<\/figcaption><\/figure><\/p>\n<p>Now let&#8217;s fill in all the input fields. Notice that when we fill in the first one, the first letter of every word is  capitalized automatically. That is happening because we set <code>textCapWords<\/code> to the <code>inputType<\/code> attribute. In addition there is no possibility of filling digits outside of the specified space. Also notice the format of the text when we try to complete the password field. Regarding the phone <code>EditText<\/code> field, we can only use digits and the maximum number of characters is 10.<\/p>\n<p>Now double click on the phone <code>EditText<\/code> field. As you can see in the next image, a <code>Toast<\/code> is appeared. It is sufficient to mention that the specific <code>EditText<\/code> can be clicked because <code>clickable<\/code> attribute is set to true.<\/p>\n<p><figure id=\"attachment_10740\" aria-describedby=\"caption-attachment-10740\" style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD2.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD2.png\" alt=\" Figure 10. Fill in the EditText fields\" width=\"256\" height=\"359\" class=\"size-full wp-image-10740\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD2.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD2-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><figcaption id=\"caption-attachment-10740\" class=\"wp-caption-text\">Figure 10. Fill in the <code>EditText<\/code> fields<\/figcaption><\/figure><\/p>\n<p>When &#8220;Display&#8221; button is pressed, another <code>Toast<\/code> is appeared on the screen. The user can see the values that he\/she has filled in the text and digit <code>EditTexts<\/code> fields. Also notice that the color of the first <code>EditText<\/code> is turned to red. That is happening because we set the respective component through the source code of the <code>Activity<\/code>, by using the suitable function.<\/p>\n<p><figure id=\"attachment_10741\" aria-describedby=\"caption-attachment-10741\" style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD3.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD3.png\" alt=\"Figure 11. Press &quot;Display&quot; button\" width=\"256\" height=\"359\" class=\"size-full wp-image-10741\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD3.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD3-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><figcaption id=\"caption-attachment-10741\" class=\"wp-caption-text\">Figure 11. &#8220;Display&#8221; button is clicked<\/figcaption><\/figure><\/p>\n<p>If we press &#8220;Next&#8221; button, a new <code>Activity<\/code> (<code>NextScreen<\/code> as we said before) will be invoked and the values of password and phone <code>EditTexts<\/code> are shown on the screen.<\/p>\n<p><figure id=\"attachment_10742\" aria-describedby=\"caption-attachment-10742\" style=\"width: 256px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD4.png\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD4.png\" alt=\"Figure 12. NextScreen Activity - &quot;Next&quot; button is pressed\" width=\"256\" height=\"359\" class=\"size-full wp-image-10742\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD4.png 256w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest_AVD4-213x300.png 213w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/a><figcaption id=\"caption-attachment-10742\" class=\"wp-caption-text\">Figure 12. <code>NextScreen<\/code> Activity &#8211; &#8220;Next&#8221; button is pressed<\/figcaption><\/figure><\/p>\n<h2>Download the Eclipse Project<\/h2>\n<p>This was an example of EditText in Android. Download the Eclipse Project of this example: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/EditTextTest.zip\">EditTextTest.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android system supports EditText, which is a subclass of TextView supplied with text editing operations. We often use EditText in our Android applications in order to provide an input or text field, especially in forms. In this example we are going to show you some commonly used EditText xml attributes and how to embody and &hellip;<\/p>\n","protected":false},"author":11,"featured_media":1202,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[540],"tags":[541],"class_list":["post-10732","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-edittext","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 EditText Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Android system supports EditText, which is a subclass of TextView supplied with text editing operations. We often use EditText in our Android applications\" \/>\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\/edittext\/android-edittext-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android EditText Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Android system supports EditText, which is a subclass of TextView supplied with text editing operations. We often use EditText in our Android applications\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-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-23T10:30:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-09T08:12:04+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=\"12 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\/edittext\/android-edittext-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/\"},\"author\":{\"name\":\"Katerina Zamani\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673\"},\"headline\":\"Android EditText Example\",\"datePublished\":\"2014-06-23T10:30:03+00:00\",\"dateModified\":\"2019-05-09T08:12:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/\"},\"wordCount\":1482,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"keywords\":[\"onClickListener\"],\"articleSection\":[\"EditText\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/\",\"name\":\"Android EditText Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg\",\"datePublished\":\"2014-06-23T10:30:03+00:00\",\"dateModified\":\"2019-05-09T08:12:04+00:00\",\"description\":\"Android system supports EditText, which is a subclass of TextView supplied with text editing operations. We often use EditText in our Android applications\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-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\/edittext\/android-edittext-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\":\"EditText\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/edittext\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Android EditText 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 EditText Example - Java Code Geeks","description":"Android system supports EditText, which is a subclass of TextView supplied with text editing operations. We often use EditText in our Android applications","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\/edittext\/android-edittext-example\/","og_locale":"en_US","og_type":"article","og_title":"Android EditText Example - Java Code Geeks","og_description":"Android system supports EditText, which is a subclass of TextView supplied with text editing operations. We often use EditText in our Android applications","og_url":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-06-23T10:30:03+00:00","article_modified_time":"2019-05-09T08:12:04+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":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/"},"author":{"name":"Katerina Zamani","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/94be714b6b9a82bb855c0d370c319673"},"headline":"Android EditText Example","datePublished":"2014-06-23T10:30:03+00:00","dateModified":"2019-05-09T08:12:04+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/"},"wordCount":1482,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","keywords":["onClickListener"],"articleSection":["EditText"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/","url":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/","name":"Android EditText Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/android-logo.jpg","datePublished":"2014-06-23T10:30:03+00:00","dateModified":"2019-05-09T08:12:04+00:00","description":"Android system supports EditText, which is a subclass of TextView supplied with text editing operations. We often use EditText in our Android applications","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/android\/core\/widget\/edittext\/android-edittext-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\/edittext\/android-edittext-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":"EditText","item":"https:\/\/examples.javacodegeeks.com\/category\/android\/core\/widget\/edittext\/"},{"@type":"ListItem","position":6,"name":"Android EditText 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\/10732","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=10732"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/10732\/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=10732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=10732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=10732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}