package com.pilot51.voicenotify;

import android.content.Intent;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;

public class MainActivity extends PreferenceActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferences);

		((Preference) findPreference("accessibility")).setOnPreferenceClickListener(new OnPreferenceClickListener() {
			public boolean onPreferenceClick(Preference preference) {
				startActivity(new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS));
				return true;
			}
		});
		
		((Preference) findPreference("appList")).setOnPreferenceClickListener(new OnPreferenceClickListener() {
			public boolean onPreferenceClick(Preference preference) {
				startActivity(new Intent(MainActivity.this, AppList.class));
				return true;
			}
		});
	}
}

@@ -126,72 +126,8 @@
 ce;%0A
-import android.preference.Preference.OnPreferenceClickListener;%0A
 impo
@@ -379,17 +379,40 @@
 es);%0A%0A%09%09
-(
+Preference accessPref = 
 (Prefere
@@ -407,33 +407,32 @@
 f = (Preference)
- 
 findPreference(%22
@@ -450,394 +450,389 @@
 ty%22)
-).setOnPreferenceClickListener(new OnPreferenceClickListener() %7B%0A%09%09%09public boolean onPreferenceClick(Preference preference) %7B%0A%09%09%09%09startActivity(new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS));%0A%09%09%09%09return true;%0A%09%09%09%7D%0A%09%09%7D);%0A%09%09%0A%09%09((Preference) findPreference(%22appList%22)).setOnPreferenceClickListener(new OnPreferenceClickListener() %7B%0A%09%09%09public boolean onPreferenceClick
+;%0A%09%09int sdkVer = android.os.Build.VERSION.SDK_INT;%0A%09%09if (sdkVer %3E 4) %7B%0A%09%09%09accessPref.setIntent(new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS));%0A%09%09%7D else if (sdkVer == 4) %7B%0A%09%09%09Intent intent = new Intent(Intent.ACTION_MAIN);%0A%09%09%09intent.setClassName(%22com.android.settings%22, %22com.android.settings.AccessibilitySettings%22);%0A%09%09%09accessPref.setIntent(intent);%0A%09%09%7D%0A%09%09%0A%09%09(
 (Pre
@@ -842,10 +842,14 @@
 ence
- p
+)findP
 refe
@@ -857,102 +857,62 @@
 ence
-) %7B%0A%09%09%09%09startActivity(new Intent(MainActivity.this, AppList.class));%0A%09%09%09%09return true;%0A%09%09%09%7D%0A%09%09%7D
+(%22appList%22)).setIntent(new Intent(this, AppList.class)
 );%0A%09

Fix crash in 1.6 at Accessibility settings intent.