set text in edittext android
EditText editText = (EditText)findViewById(R.id.edit_text);
editText.setText("This sets the text.", TextView.BufferType.EDITABLE);
set text in edittext android
EditText editText = (EditText)findViewById(R.id.edit_text);
editText.setText("This sets the text.", TextView.BufferType.EDITABLE);
and two editText fields in android studio
public void calNumbers(View view) {
EditText text = (EditText)findViewById(R.id.edit_number1);
String value = text.getText().toString();
EditText text2 = (EditText)findViewById(R.id.edit_number2);
String value2 = text2.getText().toString();
TextView answer = (TextView) findViewById(R.id.answer);
long l1 = Long.parseLong(text);
long l2 = Long.parseLong(text2);
long result = l1 + l2;
answer.setText(Long.toString(result));
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us