当前位置: 首页>>代码示例>>Java>>正文


Java MultiAutoCompleteTextView.setText方法代码示例

本文整理汇总了Java中android.widget.MultiAutoCompleteTextView.setText方法的典型用法代码示例。如果您正苦于以下问题:Java MultiAutoCompleteTextView.setText方法的具体用法?Java MultiAutoCompleteTextView.setText怎么用?Java MultiAutoCompleteTextView.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.MultiAutoCompleteTextView的用法示例。


在下文中一共展示了MultiAutoCompleteTextView.setText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setTextInTextViews

import android.widget.MultiAutoCompleteTextView; //导入方法依赖的package包/类
protected void setTextInTextViews(Location selectedItem) {
	if (plan.getFrom() != null) {
		// for(Location l : plan.getFrom())
		for (MultiAutoCompleteTextView view : textViews) {

			if (view.getText().toString().length() > 0
					&& !doesPlanContainthis(view.getText().toString())) {
				view.setText(selectedItem.getDisplayname());
				break;
			}
		}
	} else {
		textViews.get(0).setText(selectedItem.getDisplayname());
	}

}
 
开发者ID:marbergq,项目名称:Multiplanner,代码行数:17,代码来源:SearchFragment.java

示例2: handleIntent

import android.widget.MultiAutoCompleteTextView; //导入方法依赖的package包/类
/**
 * Handle {@link Intent}.
 *
 * @param intent {@link Intent}
 */
@SuppressWarnings("deprecation")
private void handleIntent(final Intent intent) {
    if (parseIntent(intent)) {
        setTheme(android.R.style.Theme_Translucent_NoTitleBar);
        send();
        finish();
    } else {
        int tid = getThreadId();
        if (tid >= 0) {
            Intent i = new Intent(Intent.ACTION_VIEW, Uri.withAppendedPath(
                    ConversationListActivity.URI, String.valueOf(tid)), this,
                    MessageListActivity.class);
            i.putExtra("showKeyboard", true);
            startActivity(i);
            finish();
        } else {
            setTheme(PreferencesActivity.getTheme(this));
            setContentView(R.layout.sender);
            findViewById(R.id.text_paste).setOnClickListener(this);
            final EditText et = (EditText) findViewById(R.id.text);
            et.addTextChangedListener(new MyTextWatcher(this, (TextView) this
                    .findViewById(R.id.text_paste), (TextView) findViewById(R.id.text_)));
            et.setText(text);
            final MultiAutoCompleteTextView mtv = (MultiAutoCompleteTextView) this
                    .findViewById(R.id.to);
            final MobilePhoneAdapter mpa = new MobilePhoneAdapter(this);
            final SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(this);
            MobilePhoneAdapter.setMobileNumbersOnly(p.getBoolean(
                    PreferencesActivity.PREFS_MOBILE_ONLY, false));
            mtv.setAdapter(mpa);
            mtv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
            mtv.setText(to);
            if (!TextUtils.isEmpty(to)) {
                to = to.trim();
                if (to.endsWith(",")) {
                    to = to.substring(0, to.length() - 1).trim();
                }
                if (to.indexOf('<') < 0) {
                    // try to fetch recipient's name from phone book
                    String n = ContactsWrapper.getInstance().getNameForNumber(
                            getContentResolver(), to);
                    if (n != null) {
                        to = n + " <" + to + ">, ";
                    }
                }
                mtv.setText(to);
                et.requestFocus();
            } else {
                mtv.requestFocus();
            }
            cbmgr = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
            int flags = et.getInputType();
            if (p.getBoolean(PreferencesActivity.PREFS_EDIT_SHORT_TEXT, true)) {
                flags |= InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
            } else {
                flags &= ~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
            }
            et.setInputType(flags);
        }
    }
}
 
开发者ID:andrewxu10,项目名称:Upkeep,代码行数:67,代码来源:SenderActivity.java

示例3: setContent

import android.widget.MultiAutoCompleteTextView; //导入方法依赖的package包/类
public AlertEdit setContent(String content) {
    mEditText = new MultiAutoCompleteTextView(mContext);
    mEditText.setText(content);
    return this;
}
 
开发者ID:ProgComRapadura,项目名称:RebDroid,代码行数:6,代码来源:AlertEdit.java

示例4: onCreate

import android.widget.MultiAutoCompleteTextView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	
	mPreferences = PreferenceManager
			.getDefaultSharedPreferences(mContext);

	swServiceState = (Switch) findViewById(R.id.swServiceState);
	fieldSendTo = (MultiAutoCompleteTextView) findViewById(R.id.fieldSendTo);
	batteryLevelView = (View) findViewById(R.id.linLayoutBatteryLevel);
	tvSetPercentage = (TextView) findViewById(R.id.tvSetPercentage);
	tvCustomMessages = (TextView) findViewById(R.id.tvCustomMessages);
	//tvConnected = (TextView) findViewById(R.id.tvConnected);
	
	

	spnrAccnt = (Spinner) findViewById(R.id.spinnerAccounts);
	spnrAccnt.setOnItemSelectedListener(onAccountChangeListener);
	
	prgrBar = (ProgressBar) findViewById(R.id.progressBar);
	prgrBar.setVisibility(View.GONE);
	
	setAlarmBatteryLevel(mPreferences.getInt(Alarm.ALARM_VALUE, CUR_PERCENTAGE_VALUE));
	
	setAuthToken(mPreferences.getString(Alarm.AUTH_TOKEN, null));
	
	setTextRecipient(mPreferences.getString(Alarm.RECIPIENT, ""));
	
	setTextSender(mPreferences.getString(Alarm.SENDER_ACCOUNT, null));
	
	setTVBatteryLevel();
	
	//setTVConnectAccount();
	
	setSPNRAccnt();
	
	setFieldSendTo();
	
	setSWServiceState();
	
	if (mPreferences.getBoolean(Alarm.SERVICE_ON, false)) {
		fieldSendTo.setText(getTextRecipient());
		fieldSendTo.setEnabled(false);
		Intent intent = new Intent(mContext, AlarmService.class);
		startService(intent);
	} else {
		if (savedInstanceState == null){
			//make field disabled until contact list is loaded
			fieldSendTo.setEnabled(false);
			//load contact list
			executeContactListLoaderTask();
		} else {
			contactList = (ArrayList<CustomContact>) savedInstanceState.getSerializable(CONTACT_LIST);
			if (contactList == null){
				executeContactListLoaderTask();
			} else {
				setContactListAdapter();
			}
		}
	}
	
	batteryLevelView.setOnClickListener(btrLvlPickerListener);
	
	
	
	//setTglBtnServiceSetCheck(tglBtnStartService);

	swServiceState.setOnCheckedChangeListener(swServiceStateListener);

}
 
开发者ID:nikablaine,项目名称:BatteryAlarm,代码行数:72,代码来源:MainActivity.java


注:本文中的android.widget.MultiAutoCompleteTextView.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。