public void setTextAppearance (Context context, int resId) Added in API level 1
This method was deprecated in API level 23. Us
You can use TextViewCompat
from the support/androidX library:
import android.support.v4.widget.TextViewCompat // for support-library
import androidx.core.widget.TextViewCompat // for androidX library
// ...
TextViewCompat.setTextAppearance(view, resId)
Internally it gets the context from the view (view.getContext()
) on API < 23.
Source for TextViewCompat
Source for TextView (API23)