Skip to content

Instantly share code, notes, and snippets.

@larryaasen
Last active December 26, 2015 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larryaasen/7100624 to your computer and use it in GitHub Desktop.
Save larryaasen/7100624 to your computer and use it in GitHub Desktop.
Android Java code to inflate a view in code and set the text size of a TextView.
LayoutInflater inflater = (LayoutInflater)this.mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(layoutId, null);
TextView text_weather = (TextView)view.findViewById(R.id.text_weather);
text_weather.setTextSize(android.util.TypedValue.COMPLEX_UNIT_PX, 132);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment