title: RecyclerView Adapter Error
body: <p>MainFragment:</p>
  
  <pre><code>public class MainFragment extends Fragment {
  RecyclerView listview;
  ListViewAdapter adapter;
  ProgressDialog mProgressDialog;
  ArrayList&lt;HashMap&lt;String, String&gt;&gt; arraylist;
  static String RANK = "rank";
  static String COUNTRY = "country";
  static String POPULATION = "population";
  static String FLAG = "flag";
  // URL Address
  String url = "http:";
  public MainFragment() {
      // Required empty public constructor
  }
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      String x = "/aaa/bbb/omer/000";
      String []tokens = x.split("/aaa/bbb/");
      for (String t: tokens)
      Toast.makeText(getActivity(), t, Toast.LENGTH_SHORT).show();
  
      View view =inflater.inflate(R.layout.fragment_main, container, false);
      listview = (RecyclerView) view.findViewById(R.id.listview);
      listview.setHasFixedSize(true);
      LinearLayoutManager llm = new LinearLayoutManager(getContext());
      listview.setLayoutManager(llm);
      new JsoupListView().execute();
      return view;
  }
  
  // Title AsyncTask
  private class JsoupListView extends AsyncTask&lt;Void, Void, Void&gt; {
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
          // Create a progressdialog
          mProgressDialog = new ProgressDialog(getActivity());
          // Set progressdialog title
          mProgressDialog.setTitle("Diziler Yükleniyor");
          // Set progressdialog message
          mProgressDialog.setMessage("Yükleniyor...");
          mProgressDialog.setIndeterminate(false);
          // Show progressdialog
          mProgressDialog.show();
      }
  
      @Override
      protected Void doInBackground(Void... params) {
          // Create an array
          arraylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
          try {
              // Connect to the Website URL
              Document doc = Jsoup.connect(url).get();
              // Identify Table Class "worldpopulation"
              for (Element table : doc.select("div[class=col-sm-12 col-xs-12 pad0 middle]")) {
  
                  // Identify all the table row's(tr)
                  for (Element row : table.select("div[class=col-sm-12 col-xs-12 pad0 streamingBoxWrap mNewsItem]:gt(0)")) {
                      HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
  
                      // Identify all the table cell's(td)
                      Elements tds = row.select("a");
  
                      // Identify all img src's
                      Elements imgSrc = row.select("img[src]");
                      // Get only src from img src
                      String imgSrcStr = imgSrc.attr("src");
  
                      Elements aSrc = row.select("a[href]:gt(1)");
                      String aSrcStr = aSrc.attr("href");
  
                      // Retrive Jsoup Elements
                      // Get the first td
                      map.put("rank", aSrcStr);
                      // Get the second td
                      map.put("country", tds.get(1).text());
                      // Get the third td
                      map.put("population", tds.get(2).text());
                      // Get the image src links
                      map.put("flag", imgSrcStr);
                      // Set all extracted Jsoup Elements into the array
                      arraylist.add(map);
                  }
              }
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
          return null;
      }
  
      @Override
      protected void onPostExecute(Void result) {
          // Locate the listview in listview_main.xml
          // Pass the results into ListViewAdapter.java
  
          adapter = new ListViewAdapter(getActivity(), arraylist);
  
          listview.setAdapter(adapter);
          listview.setItemAnimator(new DefaultItemAnimator());
  
          // Close the progressdialog
          mProgressDialog.dismiss();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>ListViewAdapter:</p>
  
  <pre><code>    public class ListViewAdapter extends BaseAdapter {
  
      // Declare Variables
      Context context;
      LayoutInflater inflater;
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; data;
      ImageLoader imageLoader;
      HashMap&lt;String, String&gt; resultp = new HashMap&lt;String, String&gt;();
  
      public ListViewAdapter(Context context,ArrayList&lt;HashMap&lt;String, String&gt;&gt; arraylist) {
          this.context = context;
          data = arraylist;
          imageLoader = new ImageLoader(context);
      }
  
  
  
      @Override
      public int getCount() {
          return data.size();
      }
  
      @Override
      public Object getItem(int position) {
          return null;
      }
  
      @Override
      public long getItemId(int position) {
          return 0;
      }
  
      public View getView(final int position, View convertView, ViewGroup parent) {
          // Declare Variables
          final TextView rank;
          TextView country;
          TextView population;
          ImageView flag;
  
          inflater = (LayoutInflater) context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
          View itemView = inflater.inflate(R.layout.singleitemview, parent, false);
          // Get the position
          resultp = data.get(position);
  
          // Locate the TextViews in listview_item.xml
         // rank = (TextView) itemView.findViewById(R.id.rank);
          country = (TextView) itemView.findViewById(R.id.country);
          population = (TextView) itemView.findViewById(R.id.population);
  
          // Locate the ImageView in listview_item.xml
          flag = (ImageView) itemView.findViewById(R.id.flag);
  
          // Capture position and set results to the TextViews
          //rank.setText(resultp.get(MainFragment.RANK));
          country.setText(resultp.get(MainFragment.COUNTRY));
          population.setText(resultp.get(MainFragment.POPULATION));
          // Capture position and set results to the ImageView
          // Passes flag images URL into ImageLoader.class
          imageLoader.DisplayImage(resultp.get(MainFragment.FLAG), flag);
          // Capture ListView item click
          itemView.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
                  // Get the position
  
                  resultp = data.get(position);
                  DiziFragment myFragment3 = new DiziFragment();
                  Bundle bundle = new Bundle();
                  bundle.putString("gun",resultp.get(MainFragment.POPULATION));
                  bundle.putString("flag",resultp.get(MainFragment.FLAG));
                  myFragment3.setArguments(bundle);
                  android.support.v4.app.FragmentTransaction fragmentTransaction = ((FragmentActivity)context).getSupportFragmentManager().beginTransaction();
                  fragmentTransaction.replace(R.id.fragment_container,myFragment3);
                  fragmentTransaction.commit();
  
              }
          });
          return itemView;
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YliZq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YliZq.png" alt="enter image description here"></a></p>
  
  <p>Gradle build
  <a href="https://i.stack.imgur.com/IeSPl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IeSPl.png" alt="enter image description here"></a></p>
  
  <p>I want to list items with recyclerview. Help me Please.</p>
  
  <p>Turkish:kodda listview ile liteliyordu ben ise recyclerview ile listelemek istiyorum.</p>
  
  <p>edit my code
  adapter:</p>
  
  <pre><code>public class SimpleRecyclerAdapter extends RecyclerView.Adapter {
  Context context;
  LayoutInflater inflater;
  ArrayList&lt;HashMap&lt;String, String&gt;&gt; data;
  ImageLoader imageLoader;
  HashMap&lt;String, String&gt; resultp = new HashMap&lt;String, String&gt;();
  
  public SimpleRecyclerAdapter(Context context,ArrayList&lt;HashMap&lt;String, String&gt;&gt; arraylist) {
      this.context = context;
      data = arraylist;
      imageLoader = new ImageLoader(context);
  }
  
  
  
  
  @Override
  public  RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, final int position) {
  
      final TextView rank;
      TextView country;
      TextView population;
      ImageView flag;
  
      inflater = (LayoutInflater) context
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      View itemView = inflater.inflate(R.layout.singleitemview, parent, false);
      // Get the position
      resultp = data.get(position);
  
      // Locate the TextViews in listview_item.xml
      // rank = (TextView) itemView.findViewById(R.id.rank);
      country = (TextView) itemView.findViewById(R.id.country);
      population = (TextView) itemView.findViewById(R.id.population);
  
      // Locate the ImageView in listview_item.xml
      flag = (ImageView) itemView.findViewById(R.id.flag);
  
      // Capture position and set results to the TextViews
      //rank.setText(resultp.get(MainFragment.RANK));
      country.setText(resultp.get(MainFragment.COUNTRY));
      population.setText(resultp.get(MainFragment.POPULATION));
      // Capture position and set results to the ImageView
      // Passes flag images URL into ImageLoader.class
      imageLoader.DisplayImage(resultp.get(MainFragment.FLAG), flag);
      // Capture ListView item click
      itemView.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View arg0) {
              // Get the position
  
              resultp = data.get(position);
              DiziFragment myFragment3 = new DiziFragment();
              Bundle bundle = new Bundle();
              bundle.putString("gun",resultp.get(MainFragment.POPULATION));
              bundle.putString("flag",resultp.get(MainFragment.FLAG));
              myFragment3.setArguments(bundle);
              android.support.v4.app.FragmentTransaction fragmentTransaction = ((FragmentActivity)context).getSupportFragmentManager().beginTransaction();
              fragmentTransaction.replace(R.id.fragment_container,myFragment3);
              fragmentTransaction.commit();
  
          }
      });
      return null;
  }
  
  @Override
  public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
  
  }
  
  @Override
  public int getItemCount() {
      return 0;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>return itemView; is eroor
  <a href="https://i.stack.imgur.com/hkeRs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hkeRs.png" alt="enter image description here"></a></p>