у меня есть этот XMLизменить стиль программно моего RelativeLayout
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/FragmentSecondary" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_alignParentTop="true"/>
<RelativeLyout>
Мой стиль его это стиль = «@ стиль/FragmentSecondary», нужно изменить его программно стиль = @ стиль/FragmentTrains. Я не хочу переписывать другой xml. Мне нужно написать его в коде. Как я могу это сделать?
Возможный дубликат: http://stackoverflow.com/questions/2016249/how-to-programmatically-setting-style-attribute-in-a-view –