title: MediaScanner, onScanCompleted is not called
body: <p>I have a problem with MediaScanner. I use it to scan a single File with this code:</p>
  
  <pre><code>public class SingleMediaScanner implements MediaScannerConnectionClient {
  
  private static final String TAG = "SingleMediaScanner";
  
  public MediaScannerConnection mMs;
  private String mFile;
  
  public SingleMediaScanner(Context context, String s) {
      mFile = s;
      mMs = new MediaScannerConnection(context, this);
      mMs.connect();
  }
  
  public void onMediaScannerConnected() {
      Log.d(TAG, "MediaScanner conectado");
      mMs.scanFile(mFile, null);
  }
  
  public void onScanCompleted(String path, Uri uri) {
      Log.d(TAG, "MediaScanner terminó de escanear");
      mMs.disconnect();
  }
  }
  </code></pre>
  
  <p>If I scan a file at the beginning of an activity (onCreate), it works perfect. The scanner is connected, it scans the file and after that, is completed.</p>
  
  <p>But if I call the scanner and then I go to another activity, the MediaScanner leaks memory because it doesn't call the onScanCompleted method. And if I use unbindService() with the scanner before leaving the activity, the scanner doesn't work (the file doesn't appear in the gallery app).</p>
  
  <p>I need to use the scanner when I leave the activity. What can I do?</p>