I have a problem in Android Studio.
I try to change the Activity background from another Activity, but when I run the application, it doesn't work and the application closes
public class Settings extends Activity
{
RelativeLayout rl ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
RadioButton st2 = (RadioButton)findViewById(R.id.style2);
final SeekBar sk = (SeekBar)findViewById(R.id.seekBar);
st2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
rl = (RelativeLayout) findViewById(R.id.mainActivity);
rl.setBackgroundResource(R.drawable.sh4);
}
});