title: Incompatible types in method onCreateLoader working with AsyncTaskLoader and Fragment
body: <p>I considered some examples of working with AsyncTaskLoader and Fragment (<a href="https://gist.github.com/codeswimmer/884591" rel="noreferrer">https://gist.github.com/codeswimmer/884591</a>) and I tried to do the same. But now I can't fix incompatible types error - in method onCreateLoader. I have no idea why it happens, because I have done the same.</p>
  
  <p><strong>FeedLoader.java</strong></p>
  
  <pre><code>public class FeedLoader extends AsyncTaskLoader&lt;ArrayList&lt;RSSItemData&gt;&gt; {
  
      ArrayList&lt;RSSItemData&gt; listData;
      Context ctx;
      RSSItemData rssItem;
      final Integer HTTP_CONNECTION_TIMEOUT = 15;
      DBHelper dbHelper;
  
  
      public FeedLoader(Context context) {
          super(context);
          this.ctx = context;
          dbHelper = new DBHelper(ctx);
      }
  
  
      @Override
      public ArrayList&lt;RSSItemData&gt; loadInBackground() {
  
          listData = new ArrayList&lt;RSSItemData&gt;();
  
          if(!BaseUtils.isNetworkAvailable(ctx)) return getNewsFromDB();
  
          if(doWeHaveAnyNews()){
  
              Log.d("myLogs", "We have news!");
  
              String data = JSONUtils.getJSON("http://I-changed-URL.com", HTTP_CONNECTION_TIMEOUT*1000, ctx);
              JSONResult result  = new Gson().fromJson(data, JSONResult.class);
              listData = result.items;
  
              deleteAllNewsFromDB();
              putNewsIntoDB(listData);
  
          }
          else{
  
              Log.d("myLogs", "No news, retrieve from database");
              listData = getNewsFromDB();
  
          }
  
          Log.d("myLogs", "Size of listData - " + listData.size());
  
          return listData;
      }
  
      public boolean doWeHaveAnyNews() {...}
      public void putNewsIntoDB(ArrayList&lt;RSSItemData&gt; listData) {...}
      public void deleteAllNewsFromDB() {...}
      public ArrayList&lt;RSSItemData&gt; getNewsFromDB() {...}
  
  }
  </code></pre>
  
  <p><strong>RetrieveFeedFragment.java</strong></p>
  
  <pre><code>public class RetrieveFeedFragment extends Fragment implements  LoaderManager.LoaderCallbacks&lt;ArrayList&lt;RSSItemData&gt;&gt; {
  
      private RecyclerView rvNews;
      LinearLayout progBarLinearLayout;
      ProgressBar progBar;
      TextView progBarText;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setRetainInstance(true);
  
          getActivity().getSupportLoaderManager().initLoader(0, null, this).forceLoad();
  
          Log.d("myLogs", "Fragment onCreate");
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          Log.d("myLogs", "Fragment onCreateView");
  
          View v = inflater.inflate(R.layout.news_list_fragment, null);
  
          rvNews = (RecyclerView) v.findViewById(R.id.listViewNews);
          LinearLayoutManager llm = new LinearLayoutManager(getActivity());
          rvNews.setLayoutManager(llm);
          rvNews.setHasFixedSize(true);
  
          rvNews = (RecyclerView) v.findViewById(R.id.listViewNews);
  
          progBarLinearLayout = (LinearLayout) v.findViewById(R.id.progressBarLinearLayout);
          progBar = (ProgressBar) v.findViewById(R.id.progressBar);
          progBarText = (TextView) v.findViewById(R.id.progressBarText);
  
          return v;
  
      }
  
  
      @Override
      public Loader&lt;ArrayList&lt;RSSItemData&gt;&gt; onCreateLoader(int id, Bundle args) {
          return new FeedLoader(getActivity());
          /* Incompatible types ERROR
         Required - anroid.support.v4.content.Loader  &lt;java.util.ArrayList&lt;com.project.myproject.RetrieveFeed.RSSItemData&gt;&gt;
         Found - com.project.myproject.RetrieveFeed.FeedLoader
         */
      }
  
      @Override
      public void onLoadFinished(Loader&lt;ArrayList&lt;RSSItemData&gt;&gt; loader, ArrayList&lt;RSSItemData&gt; listData) {
          // RSSAdapter = new RSSAdapter(listData, getActivity());
          // rvNews.setAdapter(RSSAdapter);
          // progBarLinearLayout.setVisibility(LinearLayout.GONE);
          Log.d("myLogs", "onLoadFinished");
      }
      @Override
      public void onLoaderReset(Loader&lt;ArrayList&lt;RSSItemData&gt;&gt; loader) {
          Log.d("myLogs", "onLoaderReset");
      }
  }
  </code></pre>
  
  <p><strong>MainActivity.java</strong> (just in case)</p>
  
  <pre><code>public class MainActivity extends FragmentActivity {
  
      RetrieveFeedFragment fragment;;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          if(savedInstanceState == null){
              fragment = new RetrieveFeedFragment();
              getSupportFragmentManager().beginTransaction().add(R.id.fragment_news, fragment, "retrieve_feed_tag").commit();
              Log.d("myLogs", "New Fragment in Activity");
          }
          else{
              fragment = (RetrieveFeedFragment) getSupportFragmentManager().findFragmentByTag("retrieve_feed_tag");
              Log.d("myLogs", "Get old Fragment by tag in Activity");
          }
  
      }
  }
  </code></pre>