TextView setText - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setText method.

This code example shows how to use the following methods: setPadding, setText, setTextColor, setTextSize
     
    TextView textView = (TextView)row.findViewById(android.R.id.text1);
    float scale = activity.getResources().getDisplayMetrics().density;
    boolean leftPadding = (parent.getTag().equals("right"));
    boolean topPadding = (position == 0);
    textView.setPadding((int)(20 * scale) * (leftPadding ? 2 : 1), (int)(20 * scale) * (!leftPadding && topPadding ? 1 : 0), (int)(20 * scale), 0);
    textView.setText(item);
    textView.setTextColor(Color.BLACK);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
     
    return row;
  } 
 
  private View getWebView(int position, View convertView, ViewGroup parent) {
    View row = convertView;
    if ((row == null) || (row.findViewById(1337) == null)) {
      RelativeLayout layout = new RelativeLayout(activity);
      layout.setLayoutParams(new ListView.LayoutParams(ListView.LayoutParams.FILL_PARENT, ListView.LayoutParams.WRAP_CONTENT));
      row = layout;
       
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getVisibility, setVisibility, setText
        mPreserveIconSpacing = mForceShowIcon = forceShow;
    } 
 
    public void setTitle(CharSequence title) {
        if (title != null) {
            mTitleView.setText(title);
 
            if (mTitleView.getVisibility() != VISIBLE) mTitleView.setVisibility(VISIBLE);
        } else { 
            if (mTitleView.getVisibility() != GONE) mTitleView.setVisibility(GONE);
        } 
    } 
 
    public MenuItemImpl getItemData() { 
        return mItemData;
    } 
 
    public void setCheckable(boolean checkable) {
 
        if (!checkable && mRadioButton == null && mCheckBox == null) {
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setLayoutParams, setGravity, setText
         * number. 
         */ 
        @Override 
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            TextView tv = new TextView(getActivity());
            tv.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT,
                    MATCH_PARENT));
            tv.setText("Fragment #" + mNum);
            tv.setGravity(CENTER);
            return tv;
        } 
 
    } 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setText
     
    return(btn);
  } 
   
  private View buildFooter() {
    TextView txt=new TextView(this);
     
    updateFooter(txt);
     
    return(txt);
  } 
   
  private void updateFooter(final TextView txt) {
    long runtime=(SystemClock.uptimeMillis()-startTime)/1000;
     
    txt.setText(String.valueOf(runtime)+" seconds since activity launched");
     
    if (!areWeDeadYet) {
      getListView().postDelayed(new Runnable() {
        public void run() { 

8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setId, setVisibility, setGravity, setPadding, setText

Related TextView setText Questions & Answers:

Other TextView setText Examples

15:	          s += "vogella.com ";
16:	        }
17:	        view.setText(s);
18:	    }
19:	}

Read More

51:	    String string = button.getText().toString();
52:	    int hitTarget = Integer.valueOf(string) + 1;
53:	    button.setText(String.valueOf(hitTarget));
54:	  }
55:

Read More

37:	      onLocationChanged(location);
38:	    } else {
39:	      latituteField.setText("Location not available");
40:	      longitudeField.setText("Location not available");
41:	    }
-
38:	    } else {
39:	      latituteField.setText("Location not available");
40:	      longitudeField.setText("Location not available");
41:	    }
42:	  }
-
60:	    int lat = (int) (location.getLatitude());
61:	    int lng = (int) (location.getLongitude());
62:	    latituteField.setText(String.valueOf(lat));
63:	    longitudeField.setText(String.valueOf(lng));
64:	  }
-
61:	    int lng = (int) (location.getLongitude());
62:	    latituteField.setText(String.valueOf(lat));
63:	    longitudeField.setText(String.valueOf(lng));
64:	  }
65:

Read More

31:	
32:			// Diplaying the text
33:			txtPlayCount.setText(now_playing);
34:			txtEarned.setText(earned);
35:		}
-
32:			// Diplaying the text
33:			txtPlayCount.setText(now_playing);
34:			txtEarned.setText(earned);
35:		}
36:	}

Read More

52:	         
53:	        imgIcon.setImageResource(navDrawerItems.get(position).getIcon());        
54:	        txtTitle.setText(navDrawerItems.get(position).getTitle());
55:	        
56:	        // displaying count
-
57:	        // check whether it set visible or not
58:	        if(navDrawerItems.get(position).getCounterVisibility()){
59:	        	txtCount.setText(navDrawerItems.get(position).getCount());
60:	        }else{
61:	        	// hide the counter view

Read More

82:			List<String> lables = new ArrayList<String>();
83:			
84:			txtCategory.setText("");
85:	
86:			for (int i = 0; i < categoriesList.size(); i++) {

Read More

setText Method Overview
See Code Examples for other Android TextView Methods: