Search Results

Search found 334 results on 14 pages for 'edittext'.

Page 2/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Android TextWatcher for more than one EditText

    - by Creative MITian
    I want to implement the TextWatcher interface for more than one EditText fields. Currently I am using : text1.addTextChangedListener(this); text2.addTextChangedListener(this); then overriding the methods in my Activity: public void afterTextChanged(Editable s) {} public void beforeTextChanged(CharSequence s, int start, int count, int after) {} public void onTextChanged(CharSequence s, int start, int before, int count) { // do some operation on text of text1 field // do some operation on text of text2 field } However this is working fine but I'm looking for other ways so that I can explicitly identify that in which EditText field the SoftKeyboard is currently focused.

    Read the article

  • Android edittext right align [closed]

    - by Yoav
    I am using my application with hebrew (right-to-left) layout. I have a feature where I open an activity with EditText in it - where I put some text (previously entered by the user) to be edited by him. However, when I do setText I find out that the text is aligned to the left of the edittext instead of of the right. (If I start with empty edittext then it is automatically right aligned when user starts inputting hebrew, but cursor is positioned to the left) (android:gravity="right" does not work)

    Read the article

  • Android multi line editText (Text area)

    - by Faisal khan
    I want to have 5 line in height text area following code i am using. <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:singleLine="false" android:lines="5" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" /> text area looks fine but problem is cursor is blinking in the middle of the text field i want it to blink at first line first char of the text field.

    Read the article

  • Masked Input Using EditText Widget in Android

    - by Buzzy
    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 that I can add an OnKeyListener and manually check for validity. But this is tedious and I will have to handle various edge cases. Buzzy

    Read the article

  • EditText selects by default?

    - by GuyNoir
    Whenever I have an EditText field in my android application, it is highlighted with the blinking cursor for input as soon as the activity is started (though the keyboard doesn't pop up). How can I disable this?

    Read the article

  • How to make a EditText work correctly in a ListView?

    - by TianDong
    Hallo all, I have a ListView, which contains an EditText in each of it's row. I also have an Array.The length of the Array==the Nr of the rows in the ListView. I want to store the user input (the text in the EditText) to the Arrray. E.g, if i type some text in the EditText in the first row of the ListView, i want the text to be stored in Array[0]. But how can i detect to which row the EditText belongs to? I can detect the possition of the row if the row contains a RadioGroup, but not a EditText. What if i first type some text in the EditText and sometime later i want to update mein Input? How can i update it? Thanks a lot!

    Read the article

  • Android: Hiding the keyboard in an overrided "Done" keypress of EditText

    - by Marshall Ward
    Hello, I have used a bit of Android code to override the "Done" button in my EditText field: myEditField.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { mySubroutine(); return true; } return false; } }); Activating the field calls up the keyboard, and pressing "Done" evaluates mySubroutine() successfully. However, the keyboard no longer goes away when I press "Done". How do I restore this default behaviour to the routine?

    Read the article

  • Showing edittext obliquely in android

    - by Chandra Sekhar
    I have an EditText, which generally shows parallel to the screen X-axis. I want to show it obliquely (around 45 degree to horizontal axis). Is it possible to do this in Android. Please guide me in a direction so that I can try for it. After getting the two links in the answer by pawelzeiba, I proceed a little bit in solving this, but stuck again so I put another question on this. here is the link. So please help me to solve this.

    Read the article

  • [Android] Text inserted in the edittext is overwritten

    - by Paul
    Hello.. I'm a beginner and am making a calculator (fairly easy), but it's happening the following problem: When Cline in "1" button for example, he enters this number in the EditText, but if you click again the number is overwritten instead of the inserted his side as desired. How do the numbers were placed side by side without overwriting those already there? Note: The layout of buttons and etc. I did in. XML, so I'm not using the keyboard native Android. Thanks!

    Read the article

  • How to disable EditText box in Android when using LongClick Listener

    - by user1443051
    I have EditText box which has focusable and focusableontouch enabled and all the rest are disabled in XML. The problem I am facing is that on longclick on this text box the selectAll and select pop up comes up - I would like to disable it and at the same time use the OnlongClick Funtion too.. So I tried android:longClickable="false" on XML and set the text box using LongClick listener in java Something like this: edEmailId.setOnLongClickListener(myOnLongClickListener); Didn't work I am still getting selectALL popup window. Is LongClickable in XML and SetOnlongClicklistener the same? If so how do I disable the popup? Awaiting your response! Thanks!

    Read the article

  • Contact Bubble EditText

    - by toobsco42
    I am trying to create contact bubbles in the MultiAutoCompleteTextView similiar to how it is implemented in the Google+ app. Below is a screen shot: . I have tried to extend the DynamicDrawableSpan class in order to get a spannable drawable in the background of a span of text public class BubbleSpan extends DynamicDrawableSpan { private Context c; public BubbleSpan(Context context) { super(); c = context; } @Override public Drawable getDrawable() { Resources res = c.getResources(); Drawable d = res.getDrawable(R.drawable.oval); d.setBounds(0, 0, 100, 20); return d; } } Where my oval.xml drawable is defined as so: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#00000000"/> <stroke android:width="4dp" android:color="#99000000" android:dashWidth="4dp" android:dashGap="2dp" /> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:radius="4dp" /> </shape> In my Activity class that has the MulitAutoCompleteTextView, I set the bubble span like so: final Editable e = tv.getEditableText(); final SpannableStringBuilder sb = new SpannableStringBuilder(); sb.append("some sample text"); sb.setSpan(new BubbleSpan(getApplicationContext()), 0, 6, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); e.append(sb); However, instead of the oval shape displaying behind the first 6 characters in the string, the characters are not visible and there is no oval drawable in the background. If i change the BubbleSpan's getDrawable() method to use a .png instead of a shape drawable: public Drawable getDrawable() { Resources res = c.getResources(); Drawable d = res.getDrawable(android.R.drawable.bottom_bar); d.setBounds(0, 0, 100, 20); return d; } Then the .png will show up but the characters in the string that are a part of the span will not show up. How can I make it so that the characters in the span are displayed in the foreground, meanwhile a custom shape drawable gets displayed in the background? I attempted to also use an ImageSpan instead of subclassing DynamicDrawableSpan but was unsuccessful.

    Read the article

  • saving values of editText in replaced fragment

    - by Eppo
    I have a 2 fragment layout, on the left fragment, i have a list of the different table names, on the right, i open up a different table depending on what is clicked on the right fragment. my intention, is that the first list item is clicked, then values will be entered on the table, next the second list item is clicked, the next table opens up and those values are entered. what would be the best way to store the values of the results entered in the editboxes, so i can process them all at once? I'm sure i can use onPause to save them all, but would that be the best way? Thanks

    Read the article

  • Using MonoDroid, how can I open a dialog when an EditText field gains focus?

    - by Kiada
    I made the EditText clickable but you have to "double-click" to bring the dialog box up, which isn't really desired behaviour. How can I bring the dialog box up when the EditText is clicked / gains focus? Bonus points for including a way to stop the keyboard popping up :) _createProfileDobEdtTxt.Clickable = true; _createProfileDobEdtTxt.Click += (sender, e) => { ShowDialog(DATE_OF_BIRTH_DIALOG); };

    Read the article

  • Focusable EditText inside ListView

    - by Joe
    I've spent about 6 hours on this so far, and been hitting nothing but roadblocks. The general premise is that there is some row in a ListView (whether it's generated by the adapter, or added as a header view) that contains an EditText widget and a Button. All I want to do is be able to use the jogball/arrows, to navigate the selector to individual items like normal, but when I get to a particular row -- even if I have to explicitly identify the row -- that has a focusable child, I want that child to take focus instead of indicating the position with the selector. I've tried many possibilities, and have so far had no luck. layout: <ListView android:id="@android:id/list" android:layout_height="fill_parent" android:layout_width="fill_parent" /> Header view: EditText view = new EditText(this); listView.addHeaderView(view, null, true); Assuming there are other items in the adapter, using the arrow keys will move the selection up/down in the list, as expected; but when getting to the header row, it is also displayed with the selector, and no way to focus into the EditText using the jogball. Note: tapping on the EditText will focus it at that point, however that relies on a touchscreen, which should not be a requirement. ListView apparently has two modes in this regard: 1. setItemsCanFocus(true): selector is never displayed, but the EditText can get focus when using the arrows. Focus search algorithm is hard to predict, and no visual feedback (on any rows: having focusable children or not) on which item is selected, both of which can give the user an unexpected experience. 2. setItemsCanFocus(false): selector is always drawn in non-touch-mode, and EditText can never get focus -- even if you tap on it. To make matters worse, calling editTextView.requestFocus() returns true, but in fact does not give the EditText focus. What I'm envisioning is basically a hybrid of 1 & 2, where rather than the list setting if all items are focusable or not, I want to set focusability for a single item in the list, so that the selector seamlessly transitions from selecting the entire row for non-focusable items, and traversing the focus tree for items that contain focusable children. Any takers?

    Read the article

  • How to make EditText smaller than default?

    - by Heikki Toivonen
    I need to show a large number of EditText controls on a screen, each of which will only allow entering 0-2 digits. The default EditText size is too wide for me to show enough EditText controls on a screen, but I have been unable to figure out how to make them narrower. I have tried the following attributes in XML: android:maxLength="2" android:layout_width="20dip" android:maxWidth="20px" android:ems="2" android:maxEms="2". So the question is: how can EditText be made smaller than default?

    Read the article

  • Setting EditText imeOptions to actionNext has no effect

    - by Katedral Pillon
    I have a fairly complex (not really) xml layout file. One of the views is a LinearLayout (v1) with two children: an EditText(v2) and another LinearLayout(v3). The child LinearLayout in turn has an EditText(v4) and an ImageView(v5). For EditText v2 I have imeOptions as android:imeOptions="actionNext" But when I run the app, the keyboard's return does not check to next and I want it to change to next. How do I fix this problem? Also, when user clicks next, I want focus to go to EditText v4. I do I do this? For those who really need to see some code: <LinearLayout android:id="@+id/do_txt_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/col6" android:orientation="vertical" android:visibility="gone" > <EditText android:id="@+id/gm_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:background="@drawable/coldo_text" android:hint="@string/enter_title" android:maxLines="1" android:imeOptions="actionNext" android:padding="5dp" android:textColor="pigc7" android:textSize="ads2" /> <LinearLayout android:layout_width="match_parent" android:layout_height="100dp" android:orientation="horizontal" > <EditText android:id="@+id/rev_text" android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_margin="5dp" android:layout_weight="1" android:background="@drawable/coldo_text" android:hint="@string/enter_msg" android:maxLines="2" android:padding="5dp" android:textColor="pigc7" android:textSize="ads2" /> <ImageView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:background="@drawable/colbtn_r” android:clickable="true" android:onClick=“clickAct” android:paddingLeft="5dp" android:paddingRight="5dp" android:src="@drawable/abcat” /> </LinearLayout> </LinearLayout>

    Read the article

  • Why is my Android app force closing when I try to check if an EditText has a double

    - by user336861
    Scanner scanner = new Scanner(lapsPerMile_st); if (!scanner.hasNextDouble()) { Context context = getApplicationContext(); String msg = "Please Enter Digits and Decmials Only"; int duration = Toast.LENGTH_LONG; Toast.makeText(context, msg, duration).show(); lapsPerMileEditText.setText(""); return; } else { //Edit box has only digits, Set data and display stats data.setLapsPerMile(Integer.parseInt(lapsPerMile_st)); lapsRunLabel.setVisibility(0); lapsRunTextView.setText(Integer.toString(data.getLapsRun())); milesRunLabel.setVisibility(0); milesRunTextView.setText(Double.toString(data.getLapsRun()/data.getLapsPerMile())); } <EditText android:id="@+id/mileCount" android:layout_width="100dp" android:layout_height="wrap_content" android:layout_marginTop="110dp" android:inputType="numberDecimal" android:maxLength="4" /> For some reason if I enter a non decimal number such as 3, or 5, it works fine but when I enter a floating point such as 3.4 or 5.8 it force closes. I cant seem to figure out whats going on. Any ideas? Thanks

    Read the article

  • How to limit EditText lines to 1 by coding (ignoring enter)?

    - by Vahe Musinyan
    I am trying to ignore the enter key, but i do not want to use onKeyDown() function. There is a way to do this in xml: 1. android:maxLines = "1" 2. android:lines = "1" 3. android:singleLine = "true" I actually want to do the last one by coding. Does anyone know how to do that? for (int i=0; i<numClass; i++) { temp_ll = new LinearLayout(this); temp_ll.setOrientation(LinearLayout.HORIZONTAL); temp1 = new EditText(this); InputFilter[] FilterArray = new InputFilter[1]; FilterArray[0] = new InputFilter.LengthFilter(12); temp1.setFilters(FilterArray); // set edit text length to max 12 temp1.setHint(" class name "); temp1.setSingleLine(true); temp_ll.addView(temp1); frame.addView(temp_ll); } ll.addView(frame);

    Read the article

  • How to set layout_span through code

    - by L4N0
    Hi, Does anyone know how to set/change the android:layout_span="" of an EditText in Android at runtime. I already have the EditText defined in my XML file. <TableRow android:paddingTop="20dip" android:gravity="center_horizontal"> <EditText android:layout_width="150dip" android:text="" android:layout_height="40dip" android:id="@+id/p" android:layout_span="2"></EditText></TableRow>

    Read the article

  • Problem with sizes of EditText and Button in Android

    - by DixieFlatline
    I want to make the edittext width the same size as button. My EditText is currently very small. I use relative layout. <TextView android:id="@+id/aha4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="17dip" android:text="Vzdevek:" android:layout_below="@id/aha3" /> <EditText android:id="@+id/nick" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@id/nivo" android:layout_toRightOf="@id/aha4"/> <Button android:id="@+id/poslji" android:text="Pošlji" android:layout_height="wrap_content" android:layout_width="20dip" android:typeface="serif" android:textStyle="bold" android:layout_alignParentRight="true" android:layout_below="@id/nivo" android:layout_toRightOf="@id/nick"/> What i currently get is this: What is the appropriate layout_width for edittext and button?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >