android-edittext

Exception when try to setError() in an editText inside a Popup Window

我们两清 提交于 2020-01-15 13:36:33
问题 This is my code: if(textNomeGiocatore.getText().toString().equals("")){ InputMethodManager imm = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(textNomeGiocatore.getWindowToken(), 0); textNomeGiocatore.setError("Nome giocatore necessario"); } I have an error in the row : textNomeGiocatore.setError("Nome giocatore necessario"); this is the error : android.view.WindowManager$BadTokenException: Unable to add window -- token android.view

Exception when try to setError() in an editText inside a Popup Window

六月ゝ 毕业季﹏ 提交于 2020-01-15 13:36:09
问题 This is my code: if(textNomeGiocatore.getText().toString().equals("")){ InputMethodManager imm = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(textNomeGiocatore.getWindowToken(), 0); textNomeGiocatore.setError("Nome giocatore necessario"); } I have an error in the row : textNomeGiocatore.setError("Nome giocatore necessario"); this is the error : android.view.WindowManager$BadTokenException: Unable to add window -- token android.view

how to put values of edit texts in the dialogue box

时光怂恿深爱的人放手 提交于 2020-01-15 10:12:19
问题 I want to give the output, which was entered by the user in EditText, in a detailed manner in a separate dialog box, by using the values of those entered values in the edittext. Any help will be appreciated. Here is the code: EditText editText1,editText2,editText3; Button btn,btn2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btn = (Button) findViewById(R.id.btn); btn2 = (Button) findViewById(R.id

Android EditText typed value not showing

北战南征 提交于 2020-01-15 09:07:19
问题 In my android application, i have used Search Edittext is not showing the text what i have typed, i have used Two fragments in my parent activity. This is my XML: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/landingbackground" android:orientation="vertical" >

Android EditText typed value not showing

家住魔仙堡 提交于 2020-01-15 09:07:09
问题 In my android application, i have used Search Edittext is not showing the text what i have typed, i have used Two fragments in my parent activity. This is my XML: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/landingbackground" android:orientation="vertical" >

Copying text from one EditText box to another in the same Activity on the fly, character-by-character

删除回忆录丶 提交于 2020-01-15 05:28:30
问题 I am building an application to convert Latitude and Longitudes between various formats. My layout is complete but my current challenge is this: For the Degree values, as the user enters a value in EditText1, I want it to replicate in EditText2 as they are typing, real-time, character for character. I have beat myself up trying OnTouchListener, onKeyboardActionListener, etc. Later, I will perform calculations on the Minutes, Seconds, and decimal portions as they are typed in. Since the Degree

EditText Hint Text and Icon

爷,独闯天下 提交于 2020-01-14 19:17:14
问题 I am trying to create an EditText with the hint as icon and text both together. But hint text goes to the center but I want hint text to be left aligned so that there should only be a tab space (gap) between hint icon and hint text. This is what I have tried: <EditText android:id="@+id/emailAddressInput" android:layout_width="match_parent" android:layout_height="40dp" android:ems="10" android:layout_marginTop ="20dp" android:layout_marginLeft ="20dp" android:layout_marginRight ="20dp" android

EditText Hint Text and Icon

爱⌒轻易说出口 提交于 2020-01-14 19:16:08
问题 I am trying to create an EditText with the hint as icon and text both together. But hint text goes to the center but I want hint text to be left aligned so that there should only be a tab space (gap) between hint icon and hint text. This is what I have tried: <EditText android:id="@+id/emailAddressInput" android:layout_width="match_parent" android:layout_height="40dp" android:ems="10" android:layout_marginTop ="20dp" android:layout_marginLeft ="20dp" android:layout_marginRight ="20dp" android

Permanent hint in EditText

爷,独闯天下 提交于 2020-01-14 19:08:44
问题 I have a situation where I would like the user to complete a sentence for me. For example, consider a EditText with a hint of "The last time I ". Normally, when a user clicks an EditText , the hint disappears, but I would like it to stay. Additionally, I would like the text to be permanent, so that it cannot be erased... leaving the user with only one option... complete the sentence. The first part is fairly simple, just use the setText() method of EditText to place the hint. The difficult

How to have an EditText stuck to the soft keyboard in Android

江枫思渺然 提交于 2020-01-14 13:59:22
问题 I'm trying to make something like the image below, where the keyboard automatically opens when the activity starts and the EditText and the send button stick to the keyboard. 回答1: Use the below code to pop up the soft keyboard automatically when an activity launches InputMethodManager imm = (InputMethodManager)getSystemService( Context.INPUT_METHOD_SERVICE); imm.showSoftInput(youredittext, 0); Make sure that you have not define android:windowSoftInputMode="stateHidden" in your manifest.xml.