android-edittext

Android - Keyboard not appearing in floating window

安稳与你 提交于 2019-11-27 23:33:09
问题 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);

Search Functionality for Listview

时间秒杀一切 提交于 2019-11-27 23:18:49
i'm new to android. I'm just trying to make one simple search functionality for my app. My app consists one ListView one EditText and one Button for search. My ListView contents are listed from database using custom adapter which is extends BaseAdapter Now, what i'm trying to do is, i want to search any records from ListView For example, if i've some records like Optimization, Operations, Data Mining, Computer Ethics, Computer Architecture and etc... So, when i type some record name like op The listview should listed the records which is started from op... I've referred something for this,

How to add margin between EditText and Soft Keyboard?

萝らか妹 提交于 2019-11-27 22:58:20
问题 I want to add 10dp margin between EditText and Soft Keyboard. Here is my XML: <RelativeLayout android:id="@+id/BottomLayout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:background="@drawable/bottom_glass" > <EditText android:id="@+id/message" android:layout_width="200dp" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true

How to make edittext in Android scrollable?

霸气de小男生 提交于 2019-11-27 22:44:39
I am creating a dynamic layout that contains an edit text. I want to make this edit text scrollable. questionEntry.setMaxLines(1); questionEntry.setVerticalScrollBarEnabled(true); questionEntry.setMovementMethod(new ScrollingMovementMethod()); Using this code I made my edit text scrollable. But the problem is when I am typing something. If it reaches the end of the edit text, it will stop typing my text and not automatically jump to the next line. If I press the enter key, it will jump. I want to make it automatic. andro-girl questionEntry.setScroller(new Scroller(myContext)); questionEntry

How to restrict special characters from an Android EditText field?

本秂侑毒 提交于 2019-11-27 22:43:40
How to restrict special characters from an Android EditText field? alvin Have you tried adding the android:digits="abcde.....0123456789" attribute? Although the android:digits specify that it is a numeric field, it does work for me to set it to accept letters as well, and special characters as well (tested on SDK-7). If this doesn't work then you'll have to implement KeyListener see: http://developer.android.com/reference/android/widget/TextView.html#setKeyListener(android.text.method.KeyListener) Just pass the EditText object to this method. Also add the values that is to be blocked in the

Android Development: Improve EditText Scrolling?

自作多情 提交于 2019-11-27 22:22:38
问题 Is there any way I can increase my EditText's scrolling? I want to make it scroll like it does on the web browse, smooth and fast. Is this possible? Thanks, Alex. 回答1: Webview uses Smooth scrolling. A scroll view also have this property. Add the text view inside a Scrollview. Make an ID for the scrollview and create reference in your code. Place the EditText Within this scroll view(Make the editText to Wrap Content). Enable Smooth Scrolling using the below method, public void

MultiLine EditText in Android with the cursor starting on top [duplicate]

谁说胖子不能爱 提交于 2019-11-27 21:46:16
This question already has an answer here: Changing where cursor starts in an expanded EditText 1 answer I know it seems it's an already thousand times answered issue but I haven't found anything that works for me. I have a MultiLine EditText on Android that adapts to the view size by "playing" with the weight (1) and the height (0dip). I am using gravity "top" but it starts in the middle. I guess the problem it's related with the weight. Here's the code (the parent is a LinearLayout): <EditText android:id="@+id/txtContacto" android:layout_width="fill_parent" android:layout_height="0dip"

Change Line Color of EditText - Android

江枫思渺然 提交于 2019-11-27 21:45:57
问题 Can I change the line color on EditText . When is active it has some greenish color. Is it possible to change only the color of line when is active, and how can I do this...? 回答1: You need to set background source for an edit text. Generate it http://android-holo-colors.com/ Than you can apply generated drawable as background like android:background="@drawable/my_theme_edit_text" for the custom EditText . Or you can set that background in your app theme - you will find example in .zip file

android: How to get text position from touch event

假如想象 提交于 2019-11-27 21:23:37
问题 I'm wanting to implement a custom text interface, with touch+drag selecting text and the keyboard not being raised, in contrast to the default behavior of a long-click bringing up the CCP menu and the keyboard. My understanding suggests I need this approach: onTouchEvent(event){ case touch_down: get START text position case drag get END text position set selection range from START to END } I've found out all about getSelectStart() and various methods to setting a range and such, but I cannot

EditText On A Popup Window

不羁的心 提交于 2019-11-27 21:23:33
I am developing on Android 2.2 using Java. I put an editText on a PopupWindow and it's not working. It acts like a disabled edit text, clicking on the edit text won't show the soft keyboard. How can I add an edit text on a popupWindow? Just try: AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle("Title"); alert.setMessage("Message"); // Set an EditText view to get user input final EditText input = new EditText(this); alert.setView(input); alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { /