title: Creat a divider under n'th row with custom design
body: <p>I'm using a custom row design in order to make a adapter and put it inside the listView. However since I want to have different categories inside the listView I decided to set a divider under n'th row. I tried with a if statement but doesnt get what I want.
  Here is my mainActivity:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      listview = (ListView) findViewById(R.id.drawerListChannels);
      myAdapter = new MyAdapter(this);
      listview.setAdapter(myAdapter);
      if(myAdapter.getCount()==3){ // Here is the problem
          ColorDrawable sage = new ColorDrawable(this.getResources().getColor(R.color.sage));
          listview.setDivider(sage);
          listview.setDividerHeight(2);
      }
      listview.setOnItemClickListener(this);
  
      drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
      drawerListener = new ActionBarDrawerToggle(this, drawerLayout, null, R.string.drawer_open, R.string.drawer_close) {
          @Override
          public void onDrawerOpened(View drawerView) {
              super.onDrawerOpened(drawerView);
              setTitle("Channels");
              invalidateOptionsMenu();
          }
  
          @Override
          public void onDrawerClosed(View drawerView) {
              super.onDrawerClosed(drawerView);
              setTitle("PTIVI");
              invalidateOptionsMenu();
          }
      };
      drawerLayout.setDrawerListener(drawerListener);
      getSupportActionBar().setHomeButtonEnabled(true);
      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  }
  </code></pre>
  
  <p>Here is my myAdapter class:</p>
  
  <pre><code>package com.example.ptivi.ptivi;
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.BaseAdapter;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  public class MyAdapter extends BaseAdapter {
  String[] Channels;
  int[] CountryImages = {R.drawable.saudi, R.drawable.ku,    R.drawable.iran, R.drawable.turkey};
  // Overwrite stuff
  private Context context;
  
  public MyAdapter(Context context) {
      this.context = context;
      Channels = context.getResources().getStringArray(R.array.channels);
  }
  
  @Override
  public int getCount() {
      return Channels.length;
  }
  
  @Override
  public Object getItem(int position) {
      return Channels[position];
  }
  
  @Override
  public long getItemId(int position) {
      return position;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      View row = null;
      if (convertView == null) {
          LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          row = inflater.inflate(R.layout.custom_row, parent, false);
      } else {
          row = convertView;
      }
  
      TextView titleView = (TextView) row.findViewById(R.id.textView);
      ImageView titleImageView = (ImageView) row.findViewById(R.id.imageView);
      titleView.setText(Channels[position]);
      titleImageView.setImageResource(CountryImages[position]);
  
  
      return row;
  }
  
  }
  </code></pre>
  
  <p>Is it possible to have two listViews under eachother?</p>
  
  <p>Thank you</p>