title: The method getinstance(Context) is undefined for the type AccessibilityManager
body: <p>I'm trying to create my own ImagePreference that I will use in my app preferences in order to pick the picture the user chooses to represent himself.</p>
  
  <p>I'm not too sure about what I'm doing, but basically I'm mimicking some other preference classes. So far I'm only having trouble with this method:</p>
  
  <pre><code>public class ImagePreference extends Preference {
  ...
      void sendAccessibilityEvent(View view) {
          // Since the view is still not attached we create, populate,
          // and send the event directly since we do not know when it
          // will be attached and posting commands is not as clean.
          AccessibilityManager accessibilityManager = AccessibilityManager.getInstance(getContext());
          if (mSendClickAccessibilityEvent &amp;&amp; accessibilityManager.isEnabled()) {
              AccessibilityEvent event = AccessibilityEvent.obtain();
              event.setEventType(AccessibilityEvent.TYPE_VIEW_CLICKED);
              view.onInitializeAccessibilityEvent(event);
              view.dispatchPopulateAccessibilityEvent(event);
              accessibilityManager.sendAccessibilityEvent(event);
          }
          mSendClickAccessibilityEvent = false;
      }
  </code></pre>
  
  <p>I have just copied this code from the TwoStatePreference class. I'm not even sure I need this method at all, but the compiler complains saying that the AccessibilityManager class does not contain a getInstance method.</p>
  
  <p>I thought this could be a problem with the imports, but I'm importing the same classes as TwoStatePreference does, i.e.:</p>
  
  <pre><code>import android.view.accessibility.AccessibilityManager;
  </code></pre>
  
  <p>I have lost already several hours with this problem. Any idea of why the compiler is complaining?</p>
  
  <p>Thanks!</p>