//I am setting different TextView with various content as text what I am doing is to set the typeface for all textview. custom font is also displaying fine.
((TextView) findViewById (R.id.tutor_ps_tv_home)) .setTypeface(mFace);
((TextView) findViewById (R.id.tutor_ps_tv_plus)) .setTypeface(mFace);
((TextView) findViewById (R.id.tutor_ps_tv_settings)) .setTypeface(mFace);
((TextView) findViewById (R.id.tutor_ps_tv_undo)) .setTypeface(mFace);
((TextView) findViewById (R.id.tutor_ps_tv_cam)) .setTypeface(mFace);
((TextView) findViewById (R.id.tutor_ps_tv_share)) .setTypeface(mFace);
//Is it possible to set only one id for all text view to change my typeface like this below.
android:id="@+id/all_textview"
android:id="@id/all_textview"
android:id="@id/all_textview"
android:id="@id/all_textview"
//and I will set in my activity as
((TextView) findViewById (R.id.all_textview)) .setTypeface(mFace);
// did any one know any better sol for this.
Note: I just want to change the typeface not any otherthing/use with the textview.
No.
findViewById()will still return oneTextView— it just will be a random one out of those you gave the same name to.There are examples floating around StackOverflow and elsewhere of iterating over the children of your content view, finding those that meet your criteria (e.g., are
TextViews) and changing theirTypeface.