本文整理了Java中android.widget.AutoCompleteTextView.setText()
方法的一些代码示例,展示了AutoCompleteTextView.setText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AutoCompleteTextView.setText()
方法的具体详情如下:
包路径:android.widget.AutoCompleteTextView
类名称:AutoCompleteTextView
方法名:setText
暂无
代码示例来源:origin: aporter/coursera-android
@Override
public void onItemClick(AdapterView<?> arg0, View view, int arg2,
long arg3) {
Toast.makeText(getApplicationContext(),
getString(R.string.winner_is_string, arg0.getAdapter().getItem(arg2)),
Toast.LENGTH_LONG).show();
textView.setText("");
}
});
代码示例来源:origin: stackoverflow.com
mSearchAutoComplete.setText(text);
代码示例来源:origin: robolectric/robolectric
@Test
public void shouldInvokeFilter() throws Exception {
Robolectric.getForegroundThreadScheduler().pause();
AutoCompleteTextView view =
new AutoCompleteTextView(ApplicationProvider.getApplicationContext());
view.setAdapter(adapter);
view.setText("Foo");
assertThat(adapter.getCount()).isEqualTo(2);
}
代码示例来源: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: AEFeinstein/mtg-familiar
/**
* Clears mNameField
*/
public void clearCardNameInput() {
mNameField.setText("");
}
代码示例来源:origin: googlesamples/android-AutofillFramework
private void resetFields() {
mUsernameAutoCompleteField.setText("");
mPasswordField.setText("");
}
代码示例来源:origin: zulip/zulip-android
public void onTaskComplete(String result, JSONObject jsonObject) {
Toast.makeText(ZulipActivity.this, R.string.message_sent, Toast.LENGTH_SHORT).show();
messageEt.setText("");
sendingMessage(false, sendingMsg);
}
代码示例来源:origin: zulip/zulip-android
@Override
public void clearChatBox() {
if (messageEt != null) {
if (TextUtils.isEmpty(messageEt.getText())) {
topicActv.setText("");
streamActv.setText("");
}
}
}
代码示例来源:origin: com.actionbarsherlock/actionbarsherlock
private static void setText(AutoCompleteTextView view, CharSequence text, boolean filter) {
try {
Method method = AutoCompleteTextView.class.getMethod("setText", CharSequence.class, boolean.class);
method.setAccessible(true);
method.invoke(view, text, filter);
} catch (Exception e) {
//Fallback to public API which hopefully does mostly the same thing
view.setText(text);
}
}
}
代码示例来源:origin: Attriumph/Place-Search-Service
private void clearSearchPlace() {
mPlaceSearchKeyWord.setText("");
mPlaceSearchCategory.setSelection(0);
mPlaceSearchCurrentLocation.setChecked(true);
mPlaceSearchOtherLocation.setChecked(false);
mPlaceSearchDistance.setText("");
mPlaceSearchLocation.setText("");
keywordReminder.setVisibility(View.GONE);
locationReminder.setVisibility(View.GONE);
}
代码示例来源:origin: stackoverflow.com
AutoCompleteTextView edtxInput = (AutoCompleteTextView)layout.findViewById(R.id.edtx_input);
edtxInput.setThreshold(2);
edtxInput.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View arg1, int position, long arg3) {
Console.debug(TAG, "view: " + arg1, Console.Liviu);
AutoCompleteTextView medtxInput = (AutoCompleteTextView)parent;
medtxInput.setText(((FormOption)medtxInput.getAdapter().getItem(position)).getDescription());
}
});
代码示例来源:origin: trezor/trezor-android
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
String word = adapter.getItem(i);
autocomplete.setText(word);
confirmWordIfCan(word);
}
});
代码示例来源:origin: MuShare/Httper-Android
@Override
public void bindView(MyViewHolder holder, List<Object> payloads) {
super.bindView(holder, payloads);
holder.textViewKey.setText(key);
holder.textViewValue.setText(value);
}
代码示例来源:origin: phw/Android-PwdHash
private void restoreSavedState() {
String savedSiteAddress = mPreferences.getSavedSiteAddress();
if (!savedSiteAddress.equals("")) {
mSiteAddress.setText(savedSiteAddress);
}
}
代码示例来源:origin: AmaldevTA/ChipLayout
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
autoCompleteTextView.setText(autoCompleteTextView.getText().toString() + ",");
if(onItemClickListener != null){
onItemClickListener.onItemClick(arg0, arg1, arg2, arg3);
}
}
});
代码示例来源:origin: yidun/captcha-android-demo
private void initLoginView() {
text_email = (AutoCompleteTextView) findViewById(R.id.text_email);
edit_password = (EditText) findViewById(R.id.edit_password);
button_login = (Button) findViewById(R.id.button_login);
text_email.setText("dev@dun.163.com");
text_email.setInputType(InputType.TYPE_NULL);
edit_password.setText("******");
edit_password.setInputType(InputType.TYPE_NULL);
}
代码示例来源:origin: skyun1314/WeChat-plug-in
/**
* 响应逆地理编码
*/
public void geoAddress() {
// Log.i(wodelog, "geoAddress"+ searchLatlonPoint.toString());
showDialog();
searchText.setText("");
if (searchLatlonPoint != null){
RegeocodeQuery query = new RegeocodeQuery(searchLatlonPoint, 200, GeocodeSearch.AMAP);// 第一个参数表示一个Latlng,第二参数表示范围多少米,第三个参数表示是火系坐标系还是GPS原生坐标系
geocoderSearch.getFromLocationAsyn(query);
}
}
代码示例来源:origin: adolfAn/FBReader_AS
private void editTag(int position){
myEditPosition = position;
String s = (String)getListAdapter().getItem(position);
myInputField.setText(s);
myInputField.setSelection(myInputField.getText().length());
myInputField.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(myInputField, InputMethodManager.SHOW_IMPLICIT);
}
代码示例来源:origin: Coinomi/coinomi-android
private void setSendToAddressText(String addressStr) {
// Remove listener before changing input, to avoid infinite recursion
sendToAddressView.removeTextChangedListener(receivingAddressListener);
sendToAddressView.setOnFocusChangeListener(null);
sendToAddressView.setText(addressStr);
sendToAddressView.addTextChangedListener(receivingAddressListener);
sendToAddressView.setOnFocusChangeListener(receivingAddressListener);
}
代码示例来源:origin: zadr50/Gojek
@Override
public void onResult(PlaceBuffer places) {
if( places.getStatus().isSuccess() ) {
Place place = places.get( 0 );
displayPlace( place );
mPredictTextView.setText( "" );
mAdapter.clear();
}
//Release the PlaceBuffer to prevent a memory leak
places.release();
}
} );
内容来源于网络,如有侵权,请联系作者删除!