title: Unreachable statement in onCreateView()
body: <p>I am trying to build an app with multiple fragments where all the fragments implement <code>LoaderCallbacks</code>. I've been reading posts on <em>StackOverflow</em> where most of them were pointing out to use <code>import android.support.v4.app</code> stuff. And I did. However, when I try to <code>getLoaderManager</code> from within the <code>onCreateView</code> of the fragment, I am getting an <em>Unreachable statement</em> error.</p>
  
  <p>This is one of my <em>Fragments</em>:</p>
  
  <pre><code>package com.example.android.morenews;
  
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.LoaderManager;
  import android.support.v4.content.Loader;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  import java.util.List;
  
  
  /**
   * Created by on 24.12.17.
   */
  
  public class CultureFragment extends Fragment implements LoaderManager.LoaderCallbacks&lt;List&lt;News&gt;&gt;{
      private String baseUrlString= "https://content.guardianapis.com/search?show-fields=headline,thumbnail,wordcount,trailText";
      private String LOG_TAG= CultureFragment.class.getName();
      public LoaderManager loaderManager;
  
      public Fragment fragment = this;
  
      public CultureFragment(){
          //empty constructor
      }
  
  
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
          return super.onCreateView(inflater, container, savedInstanceState);
  
          loaderManager = getLoaderManager(); &lt;-- This is where im getting the unreachable statement error.
          loaderManager.initLoader(1, null, this);
  
      }
  
      @Override
      public Loader&lt;List&lt;News&gt;&gt; onCreateLoader(int id, Bundle args) {
          Uri baseUri = Uri.parse(baseUrlString);
          Uri.Builder uriBuilder = baseUri.buildUpon();
  
          uriBuilder.appendQueryParameter("section","sports");
          uriBuilder.appendQueryParameter("page-size","20");
          uriBuilder.appendQueryParameter("api-key","test");
          uriBuilder.appendQueryParameter("format","json");
          uriBuilder.appendQueryParameter("orderBy", "newest");
  
          Log.e(LOG_TAG, " the url  " + uriBuilder.toString());
  
          return new NewsLoader(getContext(), uriBuilder.toString());
      }
  
      @Override
      public void onLoadFinished(android.support.v4.content.Loader&lt;List&lt;News&gt;&gt; loader, List&lt;News&gt; data) {
  
      }
  
      @Override
      public void onLoaderReset(android.support.v4.content.Loader&lt;List&lt;News&gt;&gt; loader) {
  
      }
  }
  </code></pre>
  
  <p>And this is my Loader class,</p>
  
  <pre><code>  package com.example.android.morenews;
  
  import android.content.Context;
  import android.support.v4.content.AsyncTaskLoader;
  
  import java.util.List;
  
  /**
   * Created by on 24.12.17.
   */
  
  public class NewsLoader extends AsyncTaskLoader&lt;List&lt;News&gt;&gt; {
  
      String mUrl;
  
      public NewsLoader(Context context, String url)
      {
          super(context);
          mUrl=url;
      }
  
      @Override
      public List&lt;News&gt; loadInBackground() {
          if (mUrl==null){
              return null;
          }
          return QueryUtils.fetchNewsFromApi(mUrl);    }
  
  
  
      @Override
      protected void onStartLoading() {
          forceLoad();
      }
  }
  </code></pre>