Android, how do I stop a pointer appearing below an EditText

As MarvinLabs pointed out, it’s a set of drawables in the Android SDK. They can be overridden though. Find these images in your sdk platform: text_select_handle_left.png text_select_handle_middle.png text_select_handle_right.png Copy them over to your drawables folder, so you have a local copy to reference. You can change the colors of these, make them empty, or whatever … Read more

How to change color of EditText handles?

For changing the handle color you can do as specified here you do it using style as <style name=”MyCustomTheme” parent=”@style/MyNotSoCustomTheme”> <item name=”android:textSelectHandle”>@drawable/text_select_handle_middle</item> <item name=”android:textSelectHandleLeft”>@drawable/text_select_handle_left</item> <item name=”android:textSelectHandleRight”>@drawable/text_select_handle_right</item> </style> For doing it programmatically check same question another reply here which is done using reflection try { final Field fEditor = TextView.class.getDeclaredField(“mEditor”); fEditor.setAccessible(true); final Object editor = fEditor.get(editText); … Read more

editText get text kotlin

This is Kotlin, not java. You do not need to get the id of it. In kotlin, just write: var editTextHello = editTextHello.text.toString() use the beauty of kotlin 😉 P.s: BTW, better to choose xml IDs like edx_hello and for the kotlin part, var editTextHello. Then you can differentiate between xml vars and kotlin vars.

null keyevent and actionid = 0 in onEditorAction() (Jelly Bean / Nexus 7)

Ended up adding in a null check for KeyEvent. Thanks to commonsware for pointing out this happens on 3.0+. Seems more like a workaround then a solution, but it works. // Search field logic. @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Log.d(TAG, “onEditorAction”); if (event != null && event.getAction() != KeyEvent.ACTION_DOWN) { … Read more

Android Hide Soft Keyboard from EditText while not losing cursor

This worked for me: // Update the EditText so it won’t popup Android’s own keyboard, since I have my own. EditText editText = (EditText)findViewById(R.id.edit_mine); editText.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { v.onTouchEvent(event); InputMethodManager imm = (InputMethodManager)v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); if (imm != null) { imm.hideSoftInputFromWindow(v.getWindowToken(), 0); } return true; } });

Android AutoCompleteTextView with chips

The official Chips library from Google (as used in Gmail, Email, Calendar, Messaging) is located at https://android.googlesource.com/platform/frameworks/opt/chips/ A simple example of how to use it can be found at https://code.google.com/p/platform-features-talk-io-2013/source/browse/src/com/example/iotalk/ChipsActivity.java