private void update() { // whether had update.zip in /mnt/sdcard FileUtils mFileUtils = new FileUtils(); if (mFileUtils.isFileExist(Utilities.mRecoveryFileName)) { // enter recovery to update if (Utilities.getRecoveryMode() == 1) { Utilities.rebootToAutoRecovery(mContext); } else { Utilities.rebootToRecovery(mContext); } } else { // TODO:can't be here } }
private void InstallInterface() { FileUtils mFileUtils = new FileUtils(); if (mFileUtils.isFileExist(Utilities.mRecoveryFileName)) { Utilities.mIslocalDownload = true; btnOperation.setText(getString(R.string.install)); LeftPromptInfo.setText(getString(R.string.Will_upgrade)); Utilities.setViewDisText(RightPromptInfo, getString(R.string.update_notice)); Progresstext.setBackground(getResources().getDrawable(R.drawable.ic_finish_pic)); } else { btnOperation.setText(getString(R.string.Quit)); LeftPromptInfo.setText(getString(R.string.No_update_file)); Utilities.setViewDisText(RightPromptInfo, getString(R.string.No_update_file_Prompt)); Progresstext.setBackground(getResources().getDrawable(R.drawable.ic_error_pic)); } }
@Override public boolean onPreferenceChange(Preference preference, Object newValue) { if (preference == mCheckBoxPreference) { Utilities.writeAutoCheck(mContext, (Boolean) newValue); if ((Boolean) newValue) { mListPreference.setEnabled(true); } else { mListPreference.setEnabled(false); } } else if (preference == mListPreference) { mListPreference.setSummary( getResources().getString(R.string.checkfrequency_summary) + (String) newValue + getResources().getString(R.string.day)); Utilities.writeCheckFrequency(mContext, Integer.valueOf((String) newValue).intValue()); } return true; }
public void findView() { mCheckBoxPreference = (CheckBoxPreference) findPreference("setcheckbox"); mCheckBoxPreference.setOnPreferenceChangeListener(this); mListPreference = (ListPreference) findPreference("setfrequency"); mListPreference.setOnPreferenceChangeListener(this); String summary = PreferenceManager.getDefaultSharedPreferences(this) .getString(mListPreference.getKey(), Utilities.readCheckFrequency(mContext) + ""); mListPreference.setSummary( getResources().getString(R.string.checkfrequency_summary) + summary + getResources().getString(R.string.day)); if (Utilities.readAutoCheck(mContext)) { mCheckBoxPreference.setChecked(Utilities.readAutoCheck(mContext)); } else { mListPreference.setEnabled(false); } }
private void show_battery_dialog() { btnOperation.setText(getString(R.string.Quit)); Progresstext.setBackground(getResources().getDrawable(R.drawable.ic_error_pic)); LeftPromptInfo.setText(getString(R.string.battery_low)); Utilities.setViewDisText(RightPromptInfo, getString(R.string.battery_notify)); }