Page 503 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 503

public  static final  String  KEY_TEMP_HIGH  =  "interval";

                    //조절이  가능한바  시크바  객체를  만듬

                          private  SeekBarPreference  seek;

                       SwitchPreference  switchs;

                          private  EditTextPreference  ip;

                            DialogPreference  preference;






                       @Override

                       public  void onCreate(Bundle savedInstanceState)  {

                             super.onCreate(savedInstanceState);




                             //  Load the preferences  from  an XML resource

                             addPreferencesFromResource(R.xml.preferences);

                             switchs=(SwitchPreference)getPreferenceScreen().findPreference("realtime");
                             seek=(SeekBarPreference)getPreferenceScreen().findPreference("interval_key");

                                  ip=(EditTextPreference)getPreferenceScreen().findPreference("ip_address");







                             switchs.setOnPreferenceChangeListener(new
                    Preference.OnPreferenceChangeListener()  {

                                  @Override

                                  public  boolean  onPreferenceChange(Preference  preference,  Object  newValue)  {
                                       boolean  hi  =  false;




                                       if(!switchs.isChecked())

                                       {

                                             seek.setEnabled(true);



            인천전자마이스터고등학교
                                                         -  496  -
   498   499   500   501   502   503   504   505   506   507   508