os.Message; </span></span></li><li><span><span class="keyword">import</span><span> android.preference.CheckBoxPreference; </span></span></li><li><span><span class="keyword">import</span><span> android.preference.Preference; </span></span></li><li><span><span class="keyword">import</span><span> android.preference.PreferenceActivity; </span></span></li><li><span><span class="keyword">import</span><span> android.preference.PreferenceScreen; </span></span></li><li><span><span class="keyword">import</span><span> android.content.SharedPreferences; </span></span></li><li><span><span class="keyword">import</span><span> android.content.SharedPreferences.Editor; </span></span></li><li><span><span class="keyword">import</span><span> android.content.pm.ActivityInfo; </span></span></li><li><span><span class="keyword">import</span><span> android.content.pm.PackageManager; </span></span></li><li><span><span class="keyword">import</span><span> android.content.pm.ResolveInfo; </span></span></li><li><span><span class="keyword">import</span><span> android.os.Bundle; </span></span></li><li><span><span class="keyword">import</span><span> android.os.Handler; </span></span></li><li><span><span class="keyword">import</span><span> android.util.Log; </span></span></li><li><span><span class="keyword">import</span><span> android.content.Context; </span></span></li><li><span><span class="keyword">import</span><span> com.android.phone.R; </span></span></li><li><span><span class="keyword">import</span><span> android.os.IMidPhoneService; </span></span></li><li><span><span class="keyword">import</span><span> android.os.RemoteException; </span></span></li><li><span><span class="keyword">import</span><span> android.os.ServiceManager; </span></span></li><li><span><span class="keyword">import</span><span> android.provider.Settings; </span></span></li><li><span> </span></li><li><span><span class="keyword">public</span><span> </span><span class="keyword">class</span><span> DectSettings </span><span class="keyword">extends</span><span> PreferenceActivity { </span></span></li><li><span> <span class="keyword">private</span><span> </span><span class="keyword">static</span><span> </span><span class="keyword">final</span><span> String TAG = </span><span class="string">"DectSettings"</span><span>; </span></span></li><li><span> </span></li><li><span> <span class="keyword">private</span><span> </span><span class="keyword">static</span><span> </span><span class="keyword">final</span><span> String BUTTON_DECT_KEY = </span><span class="string">"button_dect_module_key"</span><span>; </span></span></li><li><span> </span></li><li><span> <span class="keyword">private</span><span> CheckBoxPreference mButtonDect; </span></span></li><li><span> <span class="keyword">public</span><span> IMidPhoneService midphoneservice = </span><span class="keyword">null</span><span>; </span></span></li><li><span> </span></li><li><span> <span class="annotation">@Override</span><span> </span></span></li><li><span> <span class="keyword">protected</span><span> </span><span class="keyword">void</span><span> onCreate(Bundle icicle) { </span></span></li><li><span> <span class="keyword">super</span><span>.onCreate(icicle); </span></span></li><li><span> </span></li><li><span> <span class="comment">//dect xml</span><span> </span></span></li><li><span> addPreferencesFromResource(R.xml.dect_settings); </span></li><li><span> </span></li><li><span> mButtonDect = (CheckBoxPreference)findPreference(BUTTON_DECT_KEY); </span></li><li><span> mButtonDect.setPersistent(<span class="keyword">false</span><span>); </span></span></li><li><span> </span></li><li><span> <span class="keyword">if</span><span>(mButtonDect != </span><span class="keyword">null</span><span>) { </span></span></li><li><span> </span></li><li><span> <span class="keyword">int</span><span> dect_state = Settings.System.getInt( </span></span></li><li><span> getContentResolver(),Settings.System.DECT_SAVED_STATE, <span class="number">1</span><span>); </span></span></li><li><span> mButtonDect.setChecked( dect_state!= <span class="number">0</span><span>); </span></span></li><li><span> </span></li><li><span> Settings.System.putInt(getContentResolver(), </span></li><li><span> Settings.System.DECT_SAVED_STATE,dect_state); </span></li><li><span> Log.
Back to home |
File page
Subscribe |
Register |
Login
| N