android-edittext

How to add an EditText to a ListView

不羁的心 提交于 2019-12-25 06:44:40
问题 I'm looking to read some product details in from a database and then add them to a ListView. I then want on each line a qty EditText box where customer can add a qty in. How can I do this? I did a simple page but when I enter a qty and the scroll down and then back up again I loose the data or it even appears in another qty box on another row. 回答1: Okay so the first thing you will need to do is create a Row.xml file for the layout that you want each row in the list to have.. <?xml version="1

Done key not showing up on keyboard

时光总嘲笑我的痴心妄想 提交于 2019-12-25 06:02:18
问题 I am making an Android app and want the done key to show up on the keyboard when the user is typing into the keyboard. This is the XML code for the EditText: <EditText android:id="@+id/answer" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:gravity="center_horizontal" android:textColor="#ffffff" android:layout_marginBottom="113dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart=

Done key not showing up on keyboard

与世无争的帅哥 提交于 2019-12-25 06:01:41
问题 I am making an Android app and want the done key to show up on the keyboard when the user is typing into the keyboard. This is the XML code for the EditText: <EditText android:id="@+id/answer" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:gravity="center_horizontal" android:textColor="#ffffff" android:layout_marginBottom="113dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart=

multiple edittext with only one textwatchers for calculation in android

有些话、适合烂在心里 提交于 2019-12-25 05:55:09
问题 I will get a value from first EditText and one more value from second EditText both values are calculated and show the result in third EditText which is using only one TextWatcher in android. Please help me thank you. public class TextWatcher_Activity extends Activity { private EditText passwordEditText, passwordEditText1, passwordEditText2; private TextView textView; private View view; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

How do i get a hidden soft keyboard to show back up in WebView?

こ雲淡風輕ζ 提交于 2019-12-25 05:10:04
问题 When the user presses the go button to navigate to a certain URL, the keyboard is hidden to go away. But when someone presses on an input field within the webview it's still gone. How do I make it come back for that? 回答1: You can not control keyboard in WebView input fields. But you can change layout/views of keyboard. Here in keyboard we have options like Numeric, Characters, Symbol etc. 来源: https://stackoverflow.com/questions/11478596/how-do-i-get-a-hidden-soft-keyboard-to-show-back-up-in

Limit text length in a line EditText Android

删除回忆录丶 提交于 2019-12-25 04:27:51
问题 How to limit number of character in a line with multi-line EditText in android I am doing like this by this is not allowing multiline <EditText android:id="@+id/MsgText" android:layout_width="0dp" android:layout_height="fill_parent" android:layout_margin="5sp" android:layout_weight="1" android:background="@drawable/message_field" android:inputType="textMultiLine" android:maxLength="10" android:padding="5sp" android:hint="Type a Message" android:textColor="@color/textFieldColor" /> 回答1: You

EditText input into array

筅森魡賤 提交于 2019-12-25 04:14:52
问题 I have an input box (EditText1) 1. that i want to keep adding values and save them to an Array 2. then when am done, i can click the done button and it can take me to the next screen and I can display the values or call the values of the array.. this is what i have so far 1. Done Button Works 2. Add more button and storing to array doesn't quite work....HELP PLZ, Thanks EDIT : Here is the edited code: private EditText txt1; public static ArrayList<String> playerList = new ArrayList<String>();

Can't get String from EditText in Custom AlertDialog

余生长醉 提交于 2019-12-25 03:55:37
问题 I am in an impasse regarding getting the text from a custom AlertDialog. I get an error "NullPointerException". I have moved defining the variable containing the EditText in the AlertDialog, but I get the same error. My layout item in it's XML "pin.xml" <EditText android:id="@+id/insert_pin" android:layout_width="90dp" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:ems="10" android:gravity="center" android:inputType=

EditText.setText() Null Pointer Exception

≯℡__Kan透↙ 提交于 2019-12-25 03:55:15
问题 I have this NPE that is driving me crazy, maybe it's just "tunnel vision" but I can't solve it. I have a fragment inside an activity, and in the activity's onCreate() I instantiate fragment. Then later when the fragment is added to activity I call fragments method from the activity. The code is below transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.ActionInputFragment, settingsFragment).addToBackStack(null); transaction.commit(); if(jsonUserData != null)

InputType of EditText in Android

有些话、适合烂在心里 提交于 2019-12-25 03:38:14
问题 I want to use default keyboard for, but want also that it occurs with numeric input type. Does anybody know how to do that? Maybe there is a way to press '?123'-key programmatically? I've took a look to list of inputTypes, but none of them seems to be the proper one for my need. Thank you 回答1: You can use either of these 3: For example: android:inputType="numberDecimal" 回答2: set in ur code inputType = "number" 来源: https://stackoverflow.com/questions/4931494/inputtype-of-edittext-in-android