Tag: android-edittext

Can I get the default hint color of an EditText?

Is there a way to get the hint color from an EditText? I need the color to set it as the text color of the EditText too

Same fragments, edittext and requestfocus issue

Sorry for asking another time help on this matter, but all others posts didn’t help. Here’s the scenario: I have a Acivity (‘A’) that incorporates a Layout with a fragment inside. This fragment is swapped on user input. One of this fragments has a edittext inside, which I want to get focus on creation AND […]

Android Development: How Can I Make An EditText Plain So It's Just A White Square?

As the title says, I’ve seen EditTexts where they are just plain white with no smooth corners or orange android border when you highlight it etc. Like it looks in this app: http://s1.appbrain.com/screen?id=-2631427781674403509&i=1

Android EditText onClick Listener defined in Layout fails with obscure Exception

I want to define an onClick Listener for an EditText in the Layout-XML of may activity, but it always fails with an obscure Exception. The Layout is injected with setContentView()in the onCreate-Method of my activity. I am not using a Fragment here and I am well aware that the XML defined onClick Listener do not […]

Validation in EditText allow IP or web Url host

I am in need to give validation on my EditText such that it allows me to enter a valid ip address format ( ?.?.?.? ) ie example or web url format ( www.?.? ) ie example www.example.com logic is that if user type any numeric value first then validation(IP) will do action else user […]

Android 4.0 EditText without soft keyboard and with cursor positioning

I am attempting to define an EditText box without having the soft keyboard display automatically when the box is touched. I also need to have the blinking cursor displayed and moved based on touch. This is simple to do prior to Android 4.0 by just using mText.setInputType(InputType.TYPE_NULL). This is the only way to suppress automatic […]

Add character automatically in EditText after 6 letters

I want to automatically put a “-” after 6 letters in my EditText and I want the user can continue to write after the “-“. (I want the user writes : 1234562 and it appears 123456-2 in the EditText). But I don’t know how to do this and if it is possible. If you can […]

How to align EditText cursor properly?

I have an edit text with a 200sp size. The cursor appears in the middle. How can I make sure the cursor appears in the left corner? It looks odd being in the center. <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”fill_parent” android:layout_height=”fill_parent” > <EditText android:layout_width=”match_parent” android:layout_height=”wrap_content” android:id=”@+id/composeEditText” android:minHeight=”200sp” android:focusable=”true” android:hint=”Share an idea with the community”></EditText> […]

Possible to autocomplete a EditTextPreference?

Is it possible to have an EditTextPreference with AutoComplete attached to it? I know ho to attach one to an element with an id, but am having trouble figure out how to attach the ArrayAdapter to the preference field. This is wrong, but it’s as close as I can get. final String[] TEAMS = getResources().getStringArray(R.array.teams); […]

ImageSpan on EditText (smileys). With SwiftKey Keyboard doesnt work

I am doing a simple chat application and i want to show smileys on edittext while writing the message. I have this to identify wich characters will be subsituted by an Image throught an ImageSpan (this is called only when an smileys character is inserted on EditText): for (index = start; index < start+num_chars; index++) […]

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