android-edittext

How to disable auto-capitalization of an EditText

旧城冷巷雨未停 提交于 2019-11-29 06:47:07
This will have a really simple answer, but I can't seem to find what it is. I want to disable the auto-capitalization of an EditText so that, by default, the first letter entered with not be automatically capitalized. I still want to allow capitalization, but only if the user manually does so. I've tried android:capitalize="none" on my EditText, and I've tried android:inputType="text" but both still auto-capitalize the first letter. I don't want to use a TextWatcher because on the soft keyboard it will still show the shift key as pressed for the first letter, and I'm nit-picky and don't want

Android Email Validation on EditText

大城市里の小女人 提交于 2019-11-29 06:28:27
问题 I have one edittext and I would to to write email validation in my Editttext this is a xml code <EditText android:id="@+id/mail" android:layout_width="match_parent" android:layout_height="48dp" android:layout_alignLeft="@+id/phone" android:layout_below="@+id/phone" android:layout_marginRight="33dp" android:layout_marginTop="10dp" android:background="@drawable/edit_background" android:ems="10" android:hint="E-Mail" android:inputType="textEmailAddress" android:paddingLeft="20dp" android

Change Focus to EditText Android

青春壹個敷衍的年華 提交于 2019-11-29 06:06:58
问题 I have 2 EditText's on my Activity and set the maxLength to 5. Now I want to set the focus to editText2 , if the length of 5 is reached in editView1 ... I tried it with: editView1.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if(editView1.getText().length() == 5) editView2.requestFocus(); return false; } }); But it won't work.. 回答1: This works final EditText editText1 = (EditText) findViewById(R.id.editText1); final EditText

Android EditText in ListView - keyboard

送分小仙女□ 提交于 2019-11-29 06:04:45
问题 I've got a problem with my EditText . I use the following adapter: public class RowTextViewAdapter extends BaseAdapter { ... public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; if (rowTitles.get(position).equals("edit")) { if(et == null){ et = new EditText(activity); et.setText("Test"); } return et; } else { convertView = new TextRow(activity); holder = new ViewHolder(((TextRow) convertView).getTextView(), ((TextRow) convertView).getImageView());

Android - Keyboard not appearing in floating window

寵の児 提交于 2019-11-29 05:59:35
I'm writing an application that uses the following code to draw an edittext on the screen over running applications: WindowManager.LayoutParams params = new WindowManager.LayoutParams( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_PHONE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, PixelFormat.TRANSLUCENT); windowManager = (WindowManager) getSystemService(WINDOW_SERVICE); windowManager.addView(mEditText, params); The xml for the edittext is: <EditText android:id="@+id

EditText in PopupWindow not showing keyboard even if setFocusable(true)

烈酒焚心 提交于 2019-11-29 05:51:21
I can't seem to get this work. I already set popWindow focusable as to what I read on other forums but still no luck. xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="fill_parent" android:adjustViewBounds="true" android:background="@drawable/popbg" android:orientation="vertical" > <Button android:id="@+id/cancel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:layout_marginRight="10dp" android:layout

Set cursor position in android Edit text [duplicate]

最后都变了- 提交于 2019-11-29 05:40:47
问题 This question already has an answer here: Android EditText how to start cursor pointer at the end of all characters- not end of first line 2 answers How can i set the cursor position in android edit text? I have an edit text and on create i want to set the cursor to some times in the end some times in the middle of the text, what can i do? my edit text is as follows: android:id="@+id/editText11" android:layout_width="wrap_content" android:layout_height="200sp" android:layout_above="@+id

EditText how to activate copy/paste popup without any actionbar?

天大地大妈咪最大 提交于 2019-11-29 05:35:31
I m under delphi and i use the android framework to create an edit. When i set the theme to Theme.DeviceDefault.Light.NoActionBar then i can select some text in my EditText and i have a popup with "select all/cut/copy/paste/etc" like you can see on the picture below. However, when i select Theme.Material.Light.NoActionBar or Theme.Holo.Light.NoActionBar then i can't select any text in my EditText (i have no right or left text selection handles) and off course i don't have any copy/paste popup Is their any way to have this copy/paste popup on Theme_Material_Light_NoActionBar ? Theme

How does Kotlin property access syntax work for Java classes (i.e. EditText setText)?

我是研究僧i 提交于 2019-11-29 05:33:35
问题 I'm trying to switch my Android project to Kotlin. I have an EditText (a subclass of TextView ) for which I want to set a hint and text programmatically. The hint works as expected. For text, though, I'm getting a type mismatch exception if I try to do it using Kotlin setter syntax: val test = EditText(context) test.setHint("hint") // Lint message: "Use property access syntax" test.hint = "hint" // ok test.setText("text") // ok (no lint message) test.text = "text" // Type mismatch: inferred

Save entered text in editText via button

一曲冷凌霜 提交于 2019-11-29 05:23:01
i want to save a String 's value that is entenred in EditText using sharedPreferences. and show text when activity starts public class enteredText extends Activity { private Button savenotebutton1; private SharedPreferences savednotes; private EditText editText1; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.x1); savenotebutton1 = (Button) findViewById(R.id.savenotebutton1); editText1 = (EditText) findViewById(R.id.noteEditText1); savednotes = getSharedPreferences("notes",MODE_PRIVATE); savenotebutton1.setOnClickListener