Best code examples for TextView getText method (android.widget.TextView.getText)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView getText method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

TextView getText examples from Open Source projects
This code example shows how to use the following methods: getText, setText
29:	TextView textView = new TextView(context); 
30:	textView.setText(Html.fromHtml("<b>some</b> html text")); 
31:	assertThat(textView.getText().toString()).isEqualTo("<b>some</b> html text"); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getLinksClickable, getText, setMovementMethod, setText
34:	CharSequence content = view.getText(); 
35:	view.setText(convertNormalStringToSpannableString(content.toString())); 
36:	if (view.getLinksClickable()) { 
37:	view.setMovementMethod(LongClickableLinkMovementMethod.getInstance()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getWindowToken, getText, setText
74:	adapter.add(v.getText().toString()); 
75:	v.setText(""); 
-
80:	imm.hideSoftInputFromWindow(v.getWindowToken(), 0); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addLinks, getText, setLinkTextColor
45:	if(!TextUtils.isEmpty(notesPreview.getText())) { 
46:	notesPreview.setLinkTextColor(Color.rgb(100, 160, 255)); 
47:	Linkify.addLinks(notesPreview, Linkify.ALL); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getText, setText
50:	transcript.setText(transcript.getText().toString()+"Shaking started\n"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getVisibility, getText
100:	CharSequence text = realTextView.getText(); 
101:	return (text == null || realTextView.getVisibility() != View.VISIBLE) ? "" : text.toString(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText, getTextColors, getTextSize
64:	if (tv.getText().toString().startsWith(TEXT_SEARCH_PREFIX)) { 
65:	int textColour = tv.getTextColors().getDefaultColor(); 
66:	TextAppearance appearance = new TextAppearance(textColour, tv.getTextSize()/displayMetrics.scaledDensity); 
-
68:	if (TEXT_SEARCH_TEXT.equals(tv.getText().toString())) { 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setLayoutParams, getText, length, setText, setTextColor
182:	TextView tv = new TextView(this); 
-
187:	tv.setLayoutParams(lp); 
-
189:	tv.setText(info.activityInfo.loadLabel(getPackageManager())); 
190:	tv.setTextColor(Color.BLACK); 
191:	tv.setTextSize(15); 
-
194:	tv.setText(tv.getText(), TextView.BufferType.SPANNABLE); 
195:	Spannable str = (Spannable) tv.getText(); 
-
200:	0, tv.length(), 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getMovementMethod, getText, setMovementMethod, setText
32:	CharSequence text = view.getText(); 
-
46:	view.setText(s); 
-
49:	MovementMethod m = view.getMovementMethod(); 
-
51:	view.setMovementMethod(LinkMovementMethod.getInstance()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText, setText
161:	mLog.setText(mLog.getText() + "\n" + mDateFormat.format(new Date()) + ": " + s); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
98:	CharSequence actual = text.getText(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText, setPadding, setTextColor, setTextSize
111:	final String option = tv.getText().toString(); 
-
119:	tv.setTextSize(24.0f); 
-
124:	tv.setTextColor(Color.BLACK); 
125:	tv.setPadding(10, 3, 3, 3); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getVisibility, getText
75:	assertEquals(View.VISIBLE, textView.getVisibility()); 
76:	assertEquals(expectedText, textView.getText().toString()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
53:	data.put("text", b.getText().toString()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
68:	return te.getText().toString(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getId, getText
25:	Timber.i("A button with ID %s was clicked to say '%s'.", button.getId(), button.getText()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText, setText
52:	String string = button.getText().toString(); 
-
54:	button.setText(String.valueOf(hitTarget)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
40:	Validate field2Validator = new Validate(_field2); 
-
43:	if(field1Validator.isValid(_field1.getText().toString()) || field2Validator.isValid(_field2.getText().toString())){ 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
231:	return mTitle.getText(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setContentDescription, getText
22:	myView.setContentDescription(myView.getText()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getText
27:	if(_field1.getText().toString().length() > 0 && _field1.getText().toString().equals(_field2.getText().toString())){ 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
231:	return mTitle.getText(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked, getText
41:	if(radioMale.isChecked()) { 
42:	resultIntent.putExtra("dlr.stressrecognition.Gender", radioMale.getText()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText, setText
57:	return mUsernameView.getText().toString(); 
-
98:	mUsernameView.setText(username); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
63:	String text = (String) buttonView.getText(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
138:	setDeviceName(v.getText().toString()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText, setEnabled, setText
92:	final CharSequence currentText = moveonButton.getText(); 
93:	moveonButton.setText("Move on skickat!"); 
94:	moveonButton.setEnabled(false); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText, setText
91:	String text = v.getText().toString(); 
-
93:	v.setText(""); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
34:	assertEquals("42", textView.getText().toString()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
120:	return this.date.getText().toString(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: isChecked, setChecked, getText
46:	if (textView.isChecked()){ 
-
48:	textView.getText().toString(), false); 
-
52:	textView.getText().toString(), true); 
-
59:	textView.setChecked(!textView.isChecked()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
61:	.putExtra(prefix + ".PORT", mServerPort.getText().toString()) 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText, setText
79:	if(btn.getText().toString().trim().equals("Start Data Pull")){ 
-
85:	}else if(btn.getText().toString().trim().equals("Stop Data Pull")){ //if the text says 'stop data pull' then stop the AsyncTask 
-
89:	btn.setText("Start Data Pull"); 
90:	}else if(btn.getText().toString().trim().equals("Clear")){ //If the text says 'clear' then clear the textview that holds the results 
-
92:	btn.setText("Start Data Pull"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getId, isChecked, getText
39:	Log.d(TAG, "" + toggle.getId()); 
40:	Log.d(TAG, "" + toggle.getText()); 
41:	Log.d(TAG, "" + toggle.isChecked()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getText
37:	Toast.makeText(this, view.getText(), Toast.LENGTH_SHORT).show(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText, setText
46:	String label = btn.getText().toString(); 
-
51:	btn.setText(label); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getText
68:	item.mTextView.setText(mTextView.getText()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
204:	return this.category.getText().toString(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getText
49:	return textView.getText().toString(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setBase, start, getText
22:	String chronoText = mChronometer.getText().toString(); 
-
32:	mChronometer.setBase(SystemClock.elapsedRealtime() - stoppedMilliseconds); 
33:	mChronometer.start(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setVisibility, setBase, start, getText
353:	timer.setBase(chronoBaseTime); 
-
356:	timer.start(); 
357:	timer.setVisibility(chronoVisibility); 
358:	System.out.println("Timer - " + timer.getText()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isChecked, toggle, getText
64:	String s = (String) ctv.getText(); 
65:	ctv.toggle(); 
66:	if (ctv.isChecked()) 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getContext, getText
14:	String text = arg0.getText().toString(); 
-
21:	ArrayList<ItemLoc> itemList = utils.readGroceryListFile(arg0.getContext()); 
-
23:	utils.saveFile(itemList, arg0.getContext()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getContext, getText
52:	String text = arg0.getText().toString(); 
-
59:	ArrayList<ItemLoc> list = utils.readKnownItemsListFile(arg0.getContext()); 
-
61:	utils.saveFile(list, arg0.getContext()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getText
109:	outState.putCharSequence("startstop", mStartButton.getText()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setBase, start, getText
295:	String chronoText = timeWaitingChronometer.getText().toString(); 
-
305:	timeWaitingChronometer.setBase(SystemClock.elapsedRealtime() - stoppedMilliSec); 
-
311:	timeWaitingChronometer.start(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: isChecked, getText
48:	} else if (beta.isChecked()) { 
49:	tv.setText(beta.getText()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getId, getText
42:	if(checkedId==mRadio1.getId()) 
-
45:	mTextView1.setText(mRadio1.getText()); 
Full Snippet Info
5
CodeRank
Related TextView getText Questions & Answers:
Other TextView getText Examples
49:	
50:	  public void onClick(View view) {
51:	    String string = button.getText().toString();
52:	    int hitTarget = Integer.valueOf(string) + 1;
53:	    button.setText(String.valueOf(hitTarget));

Read More

57:				@Override
58:				public void onClick(View v) {
59:					if (txtCategory.getText().toString().trim().length() > 0) {
60:						
61:						// new category name
-
60:						
61:						// new category name
62:						String newCategory = txtCategory.getText().toString();
63:	
64:						// Call Async task to create new category

Read More

32:				@Override
33:				public void onClick(View v) {
34:					if (txtCategory.getText().toString().trim().length() > 0) {
35:						
36:						// new category name
-
35:						
36:						// new category name
37:						String newCategory = txtCategory.getText().toString();
38:	
39:						// Call Async task to create new category

Read More

getText Method Overview
Return the text the TextView is displaying.
See Also