android.widget.AutoCompleteTextView.getText()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中android.widget.AutoCompleteTextView.getText()方法的一些代码示例,展示了AutoCompleteTextView.getText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AutoCompleteTextView.getText()方法的具体详情如下:
包路径:android.widget.AutoCompleteTextView
类名称:AutoCompleteTextView
方法名:getText

AutoCompleteTextView.getText介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public void onTextChanged(CharSequence s, int start, int before,
              int count) {
 selection.setText(edit.getText());
}

代码示例来源:origin: stackoverflow.com

Intent i = new Intent(this, ActivityTwo.class);
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete);
String getrec=textView.getText().toString();

//Create the bundle
Bundle bundle = new Bundle();

//Add your data to bundle
bundle.putString(“stuff”, getrec);

//Add the bundle to the intent
i.putExtras(bundle);

//Fire that second activity
startActivity(i);

代码示例来源:origin: stackoverflow.com

AutoCompleteTextView autoComplete;
String savedText;

public void showAll() {
  savedText = autoComplete.getText().toString();
  autoComplete.setText("");
  autoComplete.showDropDown();
}

public void restore() {
  autoComplete.setText(savedText);
}

代码示例来源:origin: iTXTech/Daedalus

@Override
public void run() {
  try {
    String testDomain = textViewTestDomain.getText().toString();
    if (testDomain.equals("")) {
      testDomain = Daedalus.DEFAULT_TEST_DOMAINS[0];

代码示例来源:origin: stackoverflow.com

Intent i = new Intent(this, ActivityTwo.class);
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete);
String getrec=textView.getText().toString();
Bundle bundle = new Bundle();
bundle.putString(“stuff”, getrec);
i.putExtras(bundle);
startActivity(i);

代码示例来源:origin: AmaldevTA/ChipLayout

public List<String> getText(){
  List<String> textList = new ArrayList<>();
  for (int i = 0; i < this.getChildCount(); i++){
    AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) ((ViewGroup)this.getChildAt(i)).getChildAt(labelPosition);
    if(autoCompleteTextView.getText() != null && autoCompleteTextView.getText().toString().length() > 0){
      textList.add(autoCompleteTextView.getText().toString());
    }
  }
  return textList;
}

代码示例来源:origin: zulip/zulip-android

@Override
  public Cursor runQuery(CharSequence charSequence) {
    try {
      return makeSubjectCursor(streamActv.getText().toString(), charSequence);
    } catch (SQLException e) {
      ZLog.logException(e);
      Log.e("SQLException", "SQL not correct", e);
      return null;
    }
  }
});

代码示例来源:origin: stripe/stripe-android

@Override
  public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
    String countryEntered = mCountryAutocomplete.getText().toString();
    updateUIForCountryEntered(countryEntered);
  }
});

代码示例来源:origin: zulip/zulip-android

@Override
  public CharSequence convertToString(Cursor cursor) {
    if (cursor == null) return messageEt.getText();
    int index = cursor.getColumnIndex(Emoji.NAME_FIELD);
    String name = cursor.getString(index);
    String currText = messageEt.getText().toString();
    int numberOfColumns = cursor.getColumnCount();
    int last = (numberOfColumns > 2) ? currText.lastIndexOf("@") : currText.lastIndexOf(":");
    return TextUtils.substring(currText, 0, last) + ((numberOfColumns > 2) ? "@**" + name + "**" : ":" + name.replace(".png", "") + ":");
  }
});

代码示例来源:origin: andforce/iBeebo

@Override
public CharSequence convertResultToString(Object resultValue) {
  String ori = content.getText().toString();
  String result = ((AtUserBean) resultValue).getNickname();
  String left = ori.substring(0, atSignPosition + 1);
  String right = "";
  if (selectPosition <= ori.length() - 1)
    right = ori.substring(selectPosition);
  ori = left + result + " " + right;
  return ori;
}

代码示例来源:origin: adolfAn/FBReader_AS

public boolean onEditorAction (TextView v, int actionId, KeyEvent event){
    if(actionId == EditorInfo.IME_ACTION_DONE){
      addAuthor(myInputField.getText().toString().trim(), myEditPosition);
      myInputField.setText("");
      myEditPosition = -1;
      return false;
    }
    return true;
  }
});

代码示例来源:origin: adolfAn/FBReader_AS

public boolean onEditorAction (TextView v, int actionId, KeyEvent event){
    if(actionId == EditorInfo.IME_ACTION_DONE){
      addTag(myInputField.getText().toString(), myEditPosition);
      myInputField.setText("");
      myEditPosition = -1;
      return false;
    }
    return true;
  }
});

代码示例来源:origin: Calsign/APDE

protected ValidationResult validateKeystoreFile() {
  File file = new File(keystoreFile.getText().toString());
  
  if (file.exists() && file.isFile()) {
    return new ValidationResult(0);
  } else {
    if (keystoreFile.getText().length() > 0) {
      return new ValidationResult(1, ValidationResult.MessageSeverity.ERROR, R.string.export_signed_package_error_keystore_file_nonexistant);
    } else {
      return new ValidationResult(2, ValidationResult.MessageSeverity.INFO, R.string.export_signed_package_info_enter_keystore_file);
    }
  }
}

代码示例来源:origin: zulip/zulip-android

private void checkForChatBoxFocusRequest() {
  if (TextUtils.isEmpty(streamActv.getText().toString()) && isCurrentModeStream()) {
    streamActv.requestFocus();
  } else if (TextUtils.isEmpty(topicActv.getText().toString())) {
    topicActv.requestFocus();
  } else {
    messageEt.requestFocus();
  }
}

代码示例来源:origin: MKergall/osmbonuspack

public void onClick(View v) {
    //Hide the soft keyboard:
    InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(poiTagText.getWindowToken(), 0);
    //Start search:
    String feature = poiTagText.getText().toString();
    if (!feature.equals(""))
      Toast.makeText(v.getContext(), "Searching:\n"+feature, Toast.LENGTH_LONG).show();
    getPOIAsync(feature);
  }
});

代码示例来源:origin: playerone-id/EosCommander

@Override
protected void setUpView(View view) {
  mRootView = view;
  mScope = view.findViewById( R.id.et_scope);
  mTvCode = view.findViewById( R.id.et_code);
  view.findViewById( R.id.btn_get).setOnClickListener( v -> onGetTable() );
  view.findViewById( R.id.btn_query_table_list).setOnClickListener( v -> mPresenter.onGetTableListClicked( mTvCode.getText().toString()) );
  mTableNameSpinner = view.findViewById( R.id.sp_table_list);
  setupAccountHistory();
  mPresenter.onFinishedSetupView();
}

代码示例来源:origin: stripe/stripe-android

@Override
  public void onFocusChange(View view, boolean focused) {
    String countryEntered = mCountryAutocomplete.getText().toString();
    if (focused) {
      mCountryAutocomplete.showDropDown();
    } else {
      updateUIForCountryEntered(countryEntered);
    }
  }
});

代码示例来源:origin: zulip/zulip-android

@Override
public void clearChatBox() {
  if (messageEt != null) {
    if (TextUtils.isEmpty(messageEt.getText())) {
      topicActv.setText("");
      streamActv.setText("");
    }
  }
}

代码示例来源:origin: stripe/stripe-android

@Test
public void updateUIForCountryEntered_whenInvalidCountry_revertsToLastCountry() {
  String previousValidCountryCode = mCountryAutoCompleteTextView.getSelectedCountryCode();
  mCountryAutoCompleteTextView.setCountrySelected("FAKE COUNTRY CODE");
  assertNull(mAutoCompleteTextView.getError());
  assertEquals(mAutoCompleteTextView.getText().toString(), new Locale("", previousValidCountryCode).getDisplayCountry());
  mCountryAutoCompleteTextView.setCountrySelected(Locale.UK.getCountry());
  assertNotEquals(mAutoCompleteTextView.getText().toString(), new Locale("", previousValidCountryCode).getDisplayCountry());
  assertEquals(mAutoCompleteTextView.getText().toString(), Locale.UK.getDisplayCountry());
}

代码示例来源:origin: stripe/stripe-android

@Test
public void countryAutoCompleteTextView_whenInitialized_displaysDefaultLocaleDisplayName() {
  assertEquals(Locale.US.getCountry(), mCountryAutoCompleteTextView.getSelectedCountryCode());
  assertEquals(Locale.US.getDisplayCountry(), mAutoCompleteTextView.getText().toString());
}

相关文章

AutoCompleteTextView类方法