Java Code Examples for android.widget.EditText#setSelected()
The following examples show how to use
android.widget.EditText#setSelected() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DialpadView.java From android-dialer with Apache License 2.0 | 6 votes |
@Override protected void onFinishInflate() { setupKeypad(); mDigits = (EditText) findViewById(R.id.digits); mDelete = (ImageButton) findViewById(R.id.deleteButton); mOverflowMenuButton = findViewById(R.id.dialpad_overflow); mRateContainer = (ViewGroup) findViewById(R.id.rate_container); mIldCountry = (TextView) mRateContainer.findViewById(R.id.ild_country); mIldRate = (TextView) mRateContainer.findViewById(R.id.ild_rate); AccessibilityManager accessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); if (accessibilityManager.isEnabled()) { // The text view must be selected to send accessibility events. mDigits.setSelected(true); } }
Example 2
Source File: CommentActivity.java From android-project-wo2b with Apache License 2.0 | 6 votes |
@Override protected void initView() { if (!TextUtils.isEmpty(mTitle)) { setActionBarTitle(mTitle); } send_comment = (TextView) findViewById(R.id.send_comment); et_content = (EditText) findViewById(R.id.et_content); send_comment.setOnClickListener(this); et_content.setSelected(false); et_content.clearFocus(); //ViewUtils.hideSoftInput(this); //et_content.clearFocus(); }
Example 3
Source File: SignPostActivity.java From NGA-CLIENT-VER-OPEN-SOURCE with GNU General Public License v2.0 | 6 votes |
private void initBodyText() { mBodyText = (EditText) findViewById(R.id.reply_body_edittext); mBodyText.setSelected(true); Intent intent = getIntent(); String prefix = intent.getStringExtra("prefix"); if (prefix != null) { if (prefix.startsWith("[quote][pid=") && prefix.endsWith("[/quote]\n")) { SpannableString spanString = new SpannableString(prefix); spanString.setSpan(new BackgroundColorSpan(-1513240), 0, prefix.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); spanString.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), prefix.indexOf("[b]Post by"), prefix.indexOf("):[/b]") + 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); mBodyText.append(spanString); } else { mBodyText.append(prefix); } mBodyText.setSelection(prefix.length()); } }