當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。