android-edittext

How to know if user made an input without field listeners?

十年热恋 提交于 2019-12-12 05:45:20
问题 I have an activity with 20 EditTexts on it. I want to display a message if anything has been entered. Instead of attaching 20 listeners to each field, is there a way to know if input has been supplied(data changed)? 回答1: Here is an example of a base class that takes care of notifying subclasses if any of their EditText widgets is being used(if any exist). Depending on what you want to do when the user inputs something you may need to change my example to suit your particular case. Base

Android Multiline Edittext shrinks /disorients background when text entered

隐身守侯 提交于 2019-12-12 04:56:29
问题 I am facing issue with the multiline editTextView.I am adding single line edittext views and multiline edittext views to linearlayout(Please refer in customlayout linearlayout from below xml) programetically and also setting background.Everything working works fine but when the text is entered inside multiline edittextview the background of multiline edittextview is shrinking and further entering texts in in 2nd or 3rd line background disoriening and also background of all single line

EditText And Buttons in ListView Android

孤街醉人 提交于 2019-12-12 04:55:55
问题 I have created custom ListView which is having two TextViews , Two Buttons and one EditText , My problem is: 1) Edit text is loosing control even after adding android:descendantFocusability="beforeDescendants" to root layout and beforeDescendants blocks onItemClick and onClick of buttons 2) If I add android:descendantFocusability="BlocksDescendants" in root layout then onItemClick of list and onClick of buttons start working but EditText become untouchable even after touching edittext

EditText background image fills parent

China☆狼群 提交于 2019-12-12 04:49:47
问题 I have EditText view like this: <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:inputType="none" android:background="@drawable/writting_field" android:text="@string/test" /> But it stretches and fills parent. What is the problem? 回答1: The problem may be Image size will be bigger enough so it occupying like FILL_PARENT. To get override this , use 9Patch images. So that it takes as much size as of the Text. 回答2: If image size is same or bigger than

How to make background push up when click EditText in android (like facebook login in android)

為{幸葍}努か 提交于 2019-12-12 04:34:28
问题 I am try to make my login page like facebook login. everything done but one thing that not yet done is when I click the Email the keyboard was cover my Password so I can't type my password. how to make my Email Password Signin button push up when click in Email? this is my xml. <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout

Android listener for return key on EditText not working for every device

你说的曾经没有我的故事 提交于 2019-12-12 04:26:29
问题 I want to initialize a compose field with a listener for the return key. In the documentation it says that actionId will be EditorInfo.IME_NULL if it is being called due to the enter key being pressed. I compared actionId for that value. It also says that if triggered by a returnkey we receive KeyEvent object so i test it for KeyEvent.ACTION_UP which is the value corresponding for the release of a key. When i run the code it works for fine for a device running KitKat but in the other running

Display User Input from one activity to another in a textView

蓝咒 提交于 2019-12-12 04:19:54
问题 I tried to display User Input from my main activity to my second activity, but when I typed in and click the send button on the main activity the whole app just crashes. Please help! crash solved! Thanks a lot! However, I can't get the message to display on the second activity. MainActivity.java package com.example.dell_inspiron.sendmessage; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget

Transfer data between EditText and Text View

不想你离开。 提交于 2019-12-12 03:56:52
问题 I'm trying to make an activity that take the value of the EditText and put it in the TextView in another activity. This is the code for the first activity which contains a Textview and option menu to edit it public class Saturday extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.saturday); Intent i = getIntent(); String txt = i.getExtras().getString("txtData",""); final TextView Tclass1; Tclass1 =

EditText.SetOnEditorActionListener

故事扮演 提交于 2019-12-12 03:52:49
问题 I'm completely at a loss for implementing an action listener for the imeOption setting "actionSearch" on an EditText control. I have looked at the Android Documentation for doing this, but I can't find support for it in Mono. I've tried implementing a TextView.IOnEditorActionListener, but I can't find the OnEditorAction method to override. This is the code I'm trying to use: EditText editText = (EditText) findViewById(R.id.search); editText.setOnEditorActionListener(new OnEditorActionListener

android editText keyboard changed after setText()

不想你离开。 提交于 2019-12-12 03:48:21
问题 If I want to enter a message into an editText, I enter some digits and my keyboard looks like that: but after I add some text from code by clicking the button ( et.setText(et.getText().toString() + " " + "abc") ), keyboard changes to: is there a way to prevent this happening? 回答1: I've used editable.append instead of et.setText() and this works 回答2: You should set input type in your EditText (for example by using "android:inputType" in xml file containing the layout). See: http://developer