android-edittext

How to store Multiline EditText into SQLiteDatabase? [ANDROID]

非 Y 不嫁゛ 提交于 2019-12-12 02:39:52
问题 I'm working on an application where I've 2 Multiline EditText and I need to store them into database. i only know how to store the single line EditText. Here is my codes for inserting into database: btnSave = (Button) findViewById(R.id.btnSave); btnSave.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //startActivityForResult(new Intent(Intent.ACTION_PICK),PICK_CONTACT); likeDB.open(); long likes_id; Spinner nameSpinner = (Spinner) findViewById(R.id

Making sure EditText only returns single lowercase letters

▼魔方 西西 提交于 2019-12-12 02:32:03
问题 I'm porting my old Hangman java game to android for my programming finals in january. I've gotten most of it working but i have found that my does not do any checks for invalid characters. The invalid characters are basicly everything but lowercase letters. I have been thinking of manually entering all valid characters into an array and check each input against that. Is there an easier way to do it? Here is the code that catches the input from the appropriate EditText: final EditText

Dynamically add edit text to a layout

心不动则不痛 提交于 2019-12-12 02:23:22
问题 I am trying to add an edit text view dynamically to a layout from the java class. However from what I have implemented nothing changes on my action. This is what I have: public final void onCreate(final Bundle i){ int value = 0; isEdit = false; try { super.onCreate(i); this.setContentView(R.layout.contactedit); ContactList.soundIndicator = 0; etPhoneNumber = new ArrayList<EditText>(); this.etPhoneNumber.add((EditText) this.findViewById(R.id.etPhoneNumberInput)); this.addNumberBtn = (Button)

Getting wrong item on recyclerview list filtering & selection

走远了吗. 提交于 2019-12-12 02:15:06
问题 I have an edittext on top & below is list in recyclerview. I first use edittext to filter list & then on selecting specific item from list just print/toast on app. My problem is, I am able to filter list however, when I select specific item from list, it shows wrong item name means get from original list instead of filtered. Below is my part code inside fragment onCreateView() { recyclerView.addOnItemTouchListener(new RecyclerItemClickListener(context, new RecyclerItemClickListener

Custom “pinch to zoom” edittext cant be edited

…衆ロ難τιáo~ 提交于 2019-12-12 02:00:00
问题 My goal is to create a pinch to zoom edittext. After some googling, someone kind enough to share this class on github: public ZoomEditTextView(Context context, AttributeSet attrs) { super(context, attrs, 0); this.mContext = context; init(); } public ZoomEditTextView(Context context) { super(context, null, 0); this.mContext = context; init(); setFocusable(true); requestFocus(); /*@formatter:off this.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent

how to get text from edittext inside a dialog [duplicate]

一曲冷凌霜 提交于 2019-12-12 01:58:42
问题 This question already has answers here : Android Alert Dialog unable to find view (4 answers) Android can't get EditText getText().toString() in a Dialog (1 answer) Closed 5 years ago . Like the title said how can I get text out of EditText which is found inside a custom dialog? This is the onCreateDialog method from my dialogfragment: public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater =

Check if Edittext is empty that only accepts numbers

*爱你&永不变心* 提交于 2019-12-12 01:55:59
问题 I have 2 Edittext which only accepts numbers. I want to make sure that the fields are not empty before the submit button is pressed to stop the application from crashing. These are the 2 edittext fields i have. EditText weightText = (EditText)findViewById(R.id.WeightText); EditText heightText = (EditText)findViewById(R.id.Heighttext); Code: public class BMI extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R

how to get text from EditText within a Fragment and not activity

丶灬走出姿态 提交于 2019-12-12 01:54:17
问题 I am trying to get the text from an EditText in an XML I have:` this is my XML <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ScrollView android:id="@+id/scrollView1" android:layout_width="match_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_width="match_parent" android:layout_height="match

Android: why is setError message causing View distortion?

天大地大妈咪最大 提交于 2019-12-12 01:45:35
问题 I have two versions of an app I'm working on. The first version has a setError message that is set on an EditText UI line if the user tries to save data and the line is empty. The gradle dependencie uses version 24.0.0. The message appears correctly as: The second version of the app has the same setError code but the View looks distorted because it looks like the Edit Text line has been pushed down by the View so it no longer directly below the "Do" text and the red circular exclamation point

Custom Dialog EditText returns null

隐身守侯 提交于 2019-12-12 01:39:30
问题 Many people have faced similar issues, and I think I have followed and fixed all the issues as mentioned in all those posts on stackoverflow. setContentView to my layout initializing the edittext with dialog.findViewById But I am still stuck at the nullpointer. What am I missing ? Layout name is serverchange.xml. Contents of serverchange.xml are <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"