Tag: android-edittext

Get back key event on EditText

How can I handle the event of pressing back key while typing on an EditText? When the virtual keyboard is shown and the user presses back, it gets hidden. I want to handle this event, but setting an OnKeyListener in the EditText does not help.

make editText lose focus on back press

In my activity, I have a editText field. When the user taps on it, the editText gains the focus and the keyboard appears. Now, when the user presses the hardware back button on the phone, the keyboard disappears but the cursor remains in the Edittext, i. e., it still has the focus. Is it possible […]

display smiley in textview and edittext in android

hello i am developing chat application in which i want to insert smiley i have not much idea about it how to integrate and display in it can u give me suggestion for doing the same ? ImageGetter imageGetter = new ImageGetter() { public Drawable getDrawable(String source) { Drawable d = getResources().getDrawable( R.drawable.happy); d.setBounds(0, 0, […]

Why my EditText copy/paste menu is under the EditText? How change the z-order of popup window?

NOTE If someone know how to order (z-order) Windows added via windowmanager, i will also accept the answer because it’s will answer all the question. Actually i only find to do windowManager.removeView(MyView) following immediatly by windowManager.addView(MyView) to put a view in front of the other, but this is not ideal because it’s visually remove and […]

How can I use a custom font in the input area of an input method?

We’re developing an app where we need to use a custom font (a Typeface loaded from the app’s assets) in an EditText. The Android input method docs state the following: When input focus moves into or out of an editable text field, Android shows or hides the input method (such as the on-screen keyboard) as […]

How to make an EditText selectable but not editable on Android Ice Cream Sandwich?

I have a ListView in Activity, and in each item , I insert an EditText for show my text. I need drag the handle to select text & copy the text, but can not edit text. On Android ICS, How can I do this?

Focus issue with multiple EditTexts

I have an activity with two EditTexts. I am calling the requestFocus on the second EditText field since by default the focus goes to the first one. The focus appears to be in the second field (the second one gets the highlighted border), but if we try to enter any characters using the hardware keyboard […]

Disable Button when Edit Text Fields empty

I have two text fields and a Button. I want to disable the Button unless both EditText-Fields are not empty. I tried many solutions here at stackoverflow, but they don’t work. Here is my code: import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class […]

Masked Input Using EditText Widget in Android

Is there a way I can specify an input mask to the EditText control in Android? I want be able to specify something like ### – ## – #### for a Social Security Number. This will cause any invalid input to be rejected automatically (example, I type alphabetical characters instead of numeric digits). I realize […]

How to change the focus to next edit text in android?

The User can enter only one digit in the edit text. if he enters the value in edtText1, I want the cursor automatically moves to edtText2 and so on. The user can able to edit the text which he/she has entered already. I tried the following way. edtPasscode1.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.