@Override public void onClick(View v) { tv.setText(""); tv.requestFocus(); } });
@Override public void onClick(View v) { tv.setText(""); tv.requestFocus(); } });
public void onValidationFailed(View failedView, Rule<?> failedRule) { if (failedView instanceof Checkable) { Toast.makeText(this, failedRule.getFailureMessage(), Toast.LENGTH_SHORT).show(); } else if (failedView instanceof TextView) { TextView view = (TextView) failedView; view.requestFocus(); view.setError(failedRule.getFailureMessage()); } }
@Override public void run() { if(resultTextView!=null && resultTextView.getTag().equals(tag)) { resultTextView.append(resultString); resultTextView.requestFocus(); } } }
TextView nextField = (TextView)currentField.focusSearch(View.FOCUS_RIGHT); nextField.requestFocus();
@Override public void onFocusChange(View v, boolean hasFocus) { if (!hasFocus && mTitleMainTextMarquee) { mTvTitleMain.requestFocus(); } } });
@Override public void onFocusChange(View v, boolean hasFocus) { if (!hasFocus && mTitleSubTextMarquee) { mTvTitleMain.requestFocus(); } } });
final TextView TVLarghezza = (TextView) view.findViewById(R.id.larghezza); TVLarghezza.post(new Runnable() { @Override public void run() { TVLarghezza.requestFocus(); InputMethodManager imgr = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); imgr.showSoftInput(TVLarghezza, InputMethodManager.SHOW_IMPLICIT); } });
final TextView textView = findViewById(R.id.textView); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { textView.setText("Some text"); textView.requestFocus(); } });
@Override public void onFocusChange(View v, boolean hasFocus) { Log.d(TAG, "onFocusChange tabContent"); if (hasFocus) { tabs.get(viewPager.getCurrentItem()).requestFocus(); } } });
// Get the first component and make sure it is focusable. Note you have to use setFocusableInTouchMode and not setFocusable for this to work. TextView v = (TextView) view.findViewById(R.id.first_component_in_view); v.setFocusableInTouchMode(true); v.requestFocus();
TextView text2 = (TextView) findViewById(R.id.textView1); Button button2 = (Button) findViewById(R.id.button2); button2.setOnClickListener(new OnClickListener(){ public void onClick(View v) { text2.setFocusable(true); text2.requestFocus(); } });
private void initView() { initPopupWindow(); PolyvCoursesInfo.Course course = getArguments().getParcelable("course"); String title = ""; if (course != null) title = course.title; tv_title.setText(title); tv_title.requestFocus(); iv_finish.setOnClickListener(this); iv_share.setOnClickListener(this); }
private void onLeftButtonClick() { if (isOpen()) { close(); } else { folderName.requestFocus(); AppUtils.showSoftKeyboard(folderName); } }
@Override public void onClick(View v) { mVideoClose.requestFocus(); mVideoClose.setPressed(true); mVideoTitle.requestFocus(); mVideoTitle.setPressed(true); finish(); } });
@Override protected void onResume() { mAgentWeb.getWebLifeCycle().onResume(); super.onResume(); if (titleBar != null) { titleBar.getTextView(Gravity.CENTER | Gravity.TOP).requestFocus(); } }
private void onRightButtonClick() { if (isOpen()) { apply(); close(); } else { folderName.requestFocus(); AppUtils.showSoftKeyboard(folderName); } }
// make the title scroll! // find the title TextView TextView title = (TextView) findViewById(android.R.id.title); // set the ellipsize mode to MARQUEE and make it scroll only once title.setEllipsize(TruncateAt.MARQUEE); title.setMarqueeRepeatLimit(1); // in order to start strolling, it has to be focusable and focused title.setFocusable(true); title.setFocusableInTouchMode(true); title.requestFocus();
// make the title scroll! // find the title TextView TextView title = (TextView) findViewById(android.R.id.title); // set the ellipsize mode to MARQUEE and make it scroll only once title.setEllipsize(TruncateAt.MARQUEE); title.setMarqueeRepeatLimit(1); // in order to start strolling, it has to be focusable and focused title.setFocusable(true); title.setFocusableInTouchMode(true); title.requestFocus();
this.setTitle("my title!"); ((TextView)v.findViewById(R.id.title)).setText(this.getTitle()); TextView title = ((TextView)v.findViewById(R.id.title)); title.setEllipsize(TextUtils.TruncateAt.MARQUEE); title.setMarqueeRepeatLimit(1); // in order to start strolling, it has to be focusable and focused title.setFocusable(true); title.setSingleLine(true); title.setFocusableInTouchMode(true); title.requestFocus();