@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); cb_enable = (CheckBox) findViewById(R.id.cb_enable); cb_enable.setChecked(MainService.isImageEnable(this)); cb_enable.setOnCheckedChangeListener( new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton arg0, boolean checked) { MainService.setImageEnable(MainActivity.this, checked); if (checked) { Toast.makeText(MainActivity.this, "ÒÑÆô¶¯", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(MainActivity.this, "ÒѹرÕ", Toast.LENGTH_SHORT).show(); } } }); }