package com.rcc.tamagosan.rubikscubecontroller;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.RadioGroup;

public class SettingActivity extends AppCompatActivity {
    private RadioGroup mRadioGroup1, mRadioGroup2;
    MainActivity mact = new MainActivity();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        mRadioGroup1 = (RadioGroup) findViewById(R.id.RadioGroup1);
        mact.cColorFlag = mact.cChange;
        if (mact.cChange) {
            mRadioGroup1.check(R.id.RadioButton12);
        } else {
            mRadioGroup1.check(R.id.RadioButton11);
        }
        mRadioGroup1.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                if (checkedId == R.id.RadioButton11) {
                    mact.cChange = false;
                } else if (checkedId == R.id.RadioButton12) {
                    mact.cChange = true;
                }
            }
        });

        mRadioGroup2 = (RadioGroup) findViewById(R.id.RadioGroup2);
        if (mact.animation) {
            mRadioGroup2.check(R.id.RadioButton21);
        } else {
            mRadioGroup2.check(R.id.RadioButton22);
        }
        mRadioGroup2.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                mact.cAnimationFlag = true;
                if (checkedId == R.id.RadioButton21) {
                    mact.animation = true;
                } else if (checkedId == R.id.RadioButton22) {
                    mact.animation = false;
                }
            }
        });

        Button rtnbutton = (Button) this.findViewById(R.id.rtn);
        rtnbutton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}

@@ -354,52 +354,8 @@
 up2;
-%0A    MainActivity mact = new MainActivity();
 %0A%0A  
@@ -589,16 +589,73 @@
 CREEN);%0A
+        MainActivity mact = new MainActivity();%0A        %0A
         
@@ -779,30 +779,16 @@
 cChange)
- %7B%0A           
  mRadioG
@@ -827,38 +827,22 @@
 %0A       
- %7D
  else 
-%7B%0A            
 mRadioGr
@@ -873,26 +873,16 @@
 ton11);%0A
-        %7D%0A
         
@@ -1092,38 +1092,16 @@
 utton11)
- %7B%0A                   
  mact.cC
@@ -1122,34 +1122,32 @@
 %0A               
- %7D
  else if (checke
@@ -1172,38 +1172,16 @@
 utton12)
- %7B%0A                   
  mact.cC
@@ -1194,34 +1194,16 @@
 = true;%0A
-                %7D%0A
         
@@ -1316,30 +1316,16 @@
 imation)
- %7B%0A           
  mRadioG
@@ -1368,30 +1368,14 @@
     
- %7D
  else 
-%7B%0A            
 mRad
@@ -1410,26 +1410,16 @@
 ton22);%0A
-        %7D%0A
         
@@ -1673,38 +1673,16 @@
 utton21)
- %7B%0A                   
  mact.an
@@ -1712,18 +1712,16 @@
         
- %7D
  else if
@@ -1758,30 +1758,8 @@
 n22)
- %7B%0A                   
  mac
@@ -1783,26 +1783,8 @@
 se;%0A
-                %7D%0A
     

Update SettingActivity.java