TextView textView = findViewById(R.id.text_view); Typeface typeface = textView.getTypeface();
TextView textView = findViewById(R.id.text_view); Typeface typeface = Typeface.createFromAsset(getAssets(), "my_custom_font.ttf"); textView.setTypeface(typeface); Typeface updatedTypeface = textView.getTypeface();This code sets a custom font for the text view with the ID "text_view" and then retrieves the updated typeface to confirm that it has been changed. Package: android.widget