I create a style, added in my textview xml and worked ok, this way:
<TextView
android:id="@+id/userFeedName"
style="@style/feeds_user_connected_style"
android:text="@string/user_name"
/>
But I need to create a textview using java and use my style, I tried it:
TextView textView = new TextView(this);
textView.setTextAppearance(getApplicationContext(), R.style.feeds_user_connected_style);
textView.setText(R.string.user_name);
But android studio throw the message "setTextAppearance is deprecated". How can I fix it and use my style?