title: AccessibilityService does not start on Android 4.0.4
body: <p>I am trying to start my accessibility service on android 4.0.4 but not able to start. it works fine on 2.3.3. But no luck for updated version. I have tried this suggestion.<a href="https://stackoverflow.com/questions/12019848/accessibilityservice-is-started-but-does-not-receive-accessibilityevents-on-jell">AccessibilityService is started but does not receive AccessibilityEvents on JellyBean</a>
  Here is my code .</p>
  
  <p>public class NotificationService extends AccessibilityService {</p>
  
  <pre><code>static final String TAG = "NotificationService";
  
  
  private String getEventType(AccessibilityEvent event) {
      switch (event.getEventType()) {
          case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED:
              return "TYPE_NOTIFICATION_STATE_CHANGED";
          case AccessibilityEvent.TYPE_VIEW_CLICKED:
              return "TYPE_VIEW_CLICKED";
          case AccessibilityEvent.TYPE_VIEW_FOCUSED:
              return "TYPE_VIEW_FOCUSED";
          case AccessibilityEvent.TYPE_VIEW_LONG_CLICKED:
              return "TYPE_VIEW_LONG_CLICKED";
          case AccessibilityEvent.TYPE_VIEW_SELECTED:
              return "TYPE_VIEW_SELECTED";
          case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
              return "TYPE_WINDOW_STATE_CHANGED";
          case AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED:
              return "TYPE_VIEW_TEXT_CHANGED";
      }
      return "default";
  }
  
  private String getEventText(AccessibilityEvent event) {
      StringBuilder sb = new StringBuilder();
      for (CharSequence s : event.getText()) {
          sb.append(s);
      }
      return sb.toString();
  }
  
  
  
  
    @Override
    public void onAccessibilityEvent(AccessibilityEvent event) {
      Toast.makeText(this, "Got event from " + event.getPackageName(), Toast.LENGTH_SHORT)
              .show();
      //Vibrator v = (Vibrator) getSystemService(VIBRATOR_SERVICE);
     // v.vibrate(new long[] { 0, 250, 250, 250, 250, 250, 250, 250, 250 }, -1);
  
      Log.v(TAG, String.format(
              " onAccessibilityEvent: [type] %s [class] %s [package] %s [time] %s [text] %s",
              getEventType(event), event.getClassName(), event.getPackageName(),
              event.getEventTime(), getEventText(event)));
  
    }
  
    @Override
    public void onInterrupt() {Log.v(TAG, "onInterrupt"); }
  
    @Override
      protected void onServiceConnected() {
          super.onServiceConnected();
          Log.v(TAG, "onServiceConnected");
          AccessibilityServiceInfo info = new AccessibilityServiceInfo();
          info.flags = AccessibilityServiceInfo.DEFAULT;
          info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
          info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
          setServiceInfo(info);
      }
  </code></pre>
  
  <p>}</p>
  
  <p>And Manifest is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.watchservice"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="16" /&gt;
  
      &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.watchservice.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;service android:name=".NotificationService" android:enabled="true" 
              android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.accessibilityservice.AccessibilityService" /&gt;
          &lt;/intent-filter&gt;
          &lt;meta-data android:name="android.accessibilityservice" android:resource="@xml/accessibilityservice" /&gt;
  
      &lt;/service&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>suggest me , where am i going wrong ? </p>