android-edittext

How to create Edittext programmatically inside of DialogBox depends on Array size?

偶尔善良 提交于 2019-12-13 06:25:05
问题 I have created Dialog Box with 4 EditText. But now I need to do this by dynamically depends on API response JsonObject count. Here is my response: { "additional_charges":{ "1":"121324324", "2":"245657687", "3":"379809733", "4":"4467797894" } } If "additional_charges", has "1","2","3" ---> I have to show 3 Edittext. If "additional_charges", has "1","2","3","4" ---> I have to show 4 Edittext in Dialog box. How to do this? dialog.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk

An EditTextPreference with Minimum character requirement

我的梦境 提交于 2019-12-13 06:22:53
问题 I have an EditTextPreference that I user to allow use to set a passcode to an app. I want to require a 4-digit passcode. I set the maxLength = "4" in the xml file. Now I have the problem to not allow submit unless the entered passcode is 4 digits long. Here is what I have: <EditTextPreference android:defaultValue="" android:dependency="EnablePasscode" android:dialogMessage="Add a numeric passcode to provide access to enter the app. The passcode must be 4 digits." android:dialogTitle="Set

RecyclerView List items Search using EditText implementing filterable do not work

别说谁变了你拦得住时间么 提交于 2019-12-13 05:58:41
问题 SearchListAdapter.java RecyclerView List Search using EditText implementing filterable do not work. Please check out this code. Here in my case the list is filtered but recyclerView adapter is not changed due to which list remains same. /** * Created by Dell on 4/8/2016. */ public class SearchListAdapter extends RecyclerView.Adapter<SearchListAdapter.ViewHolder> implements Filterable { private Context context; public static ArrayList<ChapterListModel> chapterList; private List

Searching doesn't work in ArrayAdapter and ListView

安稳与你 提交于 2019-12-13 05:48:48
问题 Unfortunately I couldn't implement a search functionality in a ListView inside an ArrayAdapter. Here is a part of my MainActivity: public class MainPageActivity extends ActionBarActivity implements View.OnClickListener { private static String TAG = "MainPageActivity"; private ListView lv_medicines; private MedicineAdapter medicineAdapter; private JSONParser jsonParser; private List<Medicine> medicines; private EditText inputSearch; @Override protected void onCreate(Bundle savedInstanceState)

how to move data's from one page to the other in Android

柔情痞子 提交于 2019-12-13 05:43:57
问题 Hi in my app i have placed two edit boxes and on OK button. In the edit boxes i am getting the values such as the first name and second name. Now i want to do the following process 1. When i click the button OK i move over to the new page, here i want to display the data's entered in the edit boxes of the first page. 2.In the title bar of the second page i want display the data entered in the first edit box ie the first name entered there must be the title of the second page. how to do this

Making an EditText object accept only numeric values

筅森魡賤 提交于 2019-12-13 05:36:56
问题 I'd like to create programatically an EditText within this attribute: android:inputType="number|numberSigned|numberDecimal" In brief I'd like it to accept only numeric values. How do I have to set my EditText object? 回答1: The corresponding method for inputType is public void setInputType (int type) So something like the below should work (untested) setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_SIGNED | InputType.TYPE_NUMBER_FLAG_DECIMAL ) 来源: https://stackoverflow.com

Edit text loses content in list view on scrolling

徘徊边缘 提交于 2019-12-13 05:21:18
问题 I have multiple edit text in list view. Number of edit texts is not fixed. When list view is scrolled edit text loses its content or some other edit text that is in focus shows value of some other edit text. I have tried solutions provided on Stack Overflow but nothing is helping out. I have declared a hash map in which I'm storing position and value and then setting text in edit text from hash map but somewhere hash map is overwriting values in previously stored positions. If code is

EditText lose focus only when I leave the screen

懵懂的女人 提交于 2019-12-13 05:19:09
问题 I am trying to close the keyboard when the focus of EditText has been lost. And I use this code for that edt.setOnFocusChangeListener(new View.OnFocusChangeListener() { public void onFocusChange(View v, boolean hasFocus) { if (!hasFocus) { InputMethodManager imm = (InputMethodManager) getBaseContext().getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(v.getWindowToken(), 0); Log.d(TAG, "edt focus lost"); } if (hasFocus) Log.d(TAG, "edt has focus"); } }); When I touch it, I

There are two keyboards appear when press on an Edit text

懵懂的女人 提交于 2019-12-13 05:05:57
问题 I am trying on a view as below: A EditText A RecycleView Result : When I press on edit text, then there 2 keyboards which appear in order. PS: THIS ISSUE DON'T HAPPEN WITH SINGLE EDIT TEXT! Tested on device: Samsung A5, anroid 6.0. Share screen shot and apk: https://drive.google.com/drive/folders/1Kw4DPk4iHtfXzVgrpTe4vzDwbRKvsy4X <EditText android:id="@+id/editText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout

How to implement listener text changes in custom ListView with edittexts?

若如初见. 提交于 2019-12-13 04:55:25
问题 im trying to save the values of Edittext in the ListView and it works, but when there is a ListView too large, when Im editing 1 edittext, if I scroll the listview, another EditText is editing at the same time... I don't know what to do, I wasted 6hours, and got nothing. If some can help me, please. This is the code of the getView of the Custom Listview @Override public View getView(int position, View convertView, ViewGroup parent) { final int position2 = position; View v = convertView; final