title: Migration to Android X - RestartLoader not working
body: <p>I am new to Android application development and I am currently working on an existing Android application. From the Android documentation link <a href="https://developer.android.com/distribute/best-practices/develop/target-sdk" rel="nofollow noreferrer">https://developer.android.com/distribute/best-practices/develop/target-sdk</a>
  it says that app updates must target at least Android 9.0.</p>
  
  <p>So, I have set my targetSDKVersion to 28 and tried to run the application but restartLoader is not working as expected. The application is getting closed immediately when it tries to access the following line in the code.</p>
  
  <pre><code>this.getLoaderManager().restartLoader(1, params, this); 
  </code></pre>
  
  <p>It works fine when I set the targetSDKVersion to 27. I have also found that the LoaderManager is deprecated in API level 28 and they have suggested to use the Support Library as mentioned in the link
  <a href="https://developer.android.com/reference/android/app/LoaderManager" rel="nofollow noreferrer">https://developer.android.com/reference/android/app/LoaderManager</a>.</p>
  
  <p>So I have migrated the entire project to AndroidX such that the restartLoader works fine but I am getting the same issue. I have made many changes to the dependencies of the build.gradle file as the one shown below but still the restartLoader is not working. I have tried setting many dependencies but it is of no use.</p>
  
  <pre><code>dependencies {
      //implementation files('libs/android-support-v13.jar')
      implementation "com.android.support:loader:28.0.0-alpha1"
      implementation "com.android.support:support-fragment:28.0.0"
  }
  </code></pre>
  
  <p>How can I fix the issue that is getting occurred when trying to access the <code>restartLoader()</code>?</p>