ListView - Change Divider Color only on the First Item
<p>So actually I have a MapActivity and ListActivity in one screen, when the user clicks one of the Pin on the Map, the clicked location will be on the top of the List and have a different background and divider color.</p>

<p>So I initiate to send the latitude of the clicked Pin and retrieve it on the getView(), if the clicked latitude is same with the displayed latitude on the first entry, it will do something.</p>

<p>I've managed to make the first entry of the ListView to have a certain background, but when I scroll down the List, some of the other entries' background are also changed.</p>

<p>Here is my method:</p>

<pre><code>double selectedLat = WWHApplication.getSelectedLatitude();
            DecimalFormat df = new DecimalFormat("#.#####");

            String dLat = df.format(lat);
            String sLat = df.format(selectedLat);
            if (position == 0) {
                if (dLat.equals(sLat)) {
                    feedViewHolder.layout
                            .setBackgroundResource(R.drawable.list_segment_selected);

                }
            }
</code></pre>

<p>How to change the color of the divider and the background of the ListView only on the first item?
I really appreciate if someone can help me in this case, I open to any other solutions as well.
Thank you.</p>

<p><strong>UPDATED</strong>:
here's the <code>getView()</code> method</p>

<pre><code>@Override
        public View getView(final int position, View convertView,
                ViewGroup parent) {
            layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            FeedViewHolder feedViewHolder = null;
            final VideoLocationDB vidLocation = videoLocationsDB[position];
            String url = vidLocation.documentary_thumbnail_url;
            String name = vidLocation.name;
            String title = vidLocation.name;
            String desc = vidLocation.text;
            double lat = vidLocation.latitude;
            double lng = vidLocation.longitude;
            String distance = calculateDistance(lat, lng);

            // System.out.println("ON LOC DISTANCE: "+distance);
            if (convertView == null) {

                // convertView = LocationsListActivity.this.getLayoutInflater()
                // .inflate(R.layout.listitems, null, true);
                convertView = layoutInflater.inflate(R.layout.listitems,
                        parent, false);
                feedViewHolder = new FeedViewHolder();
                feedViewHolder.layout = (LinearLayout) convertView
                        .findViewById(R.id.list_bg);
                feedViewHolder.titleView = (TextView) convertView
                        .findViewById(R.id.txt_title);
                feedViewHolder.descView = (TextView) convertView
                        .findViewById(R.id.txt_list_desc);
                feedViewHolder.more = (TextView) convertView
                        .findViewById(R.id.txt_more);
                feedViewHolder.distanceView = (TextView) convertView
                        .findViewById(R.id.txt_distance);
                feedViewHolder.v = (ImageView) convertView
                        .findViewById(R.id.image);

                Typeface fontRegular = Typeface.createFromAsset(getAssets(),
                        "miso.otf");
                feedViewHolder.titleView.setTypeface(fontRegular);
                Typeface fontLight = Typeface.createFromAsset(getAssets(),
                        "miso-light.otf");
                feedViewHolder.descView.setTypeface(fontLight);
                feedViewHolder.more.setTypeface(fontLight);
                feedViewHolder.distanceView.setTypeface(fontRegular);

                convertView.setTag(feedViewHolder);

            } else {
                feedViewHolder = (FeedViewHolder) convertView.getTag();
            }

            feedViewHolder.v.setTag(url);
            loader.DisplayImage(url, LocationsListActivity.this,
                    feedViewHolder.v, name);

            double selectedLat = WWHApplication.getSelectedLatitude();
            DecimalFormat df = new DecimalFormat("#.#####");

            String dLat = df.format(lat);
            String sLat = df.format(selectedLat);
            if (position == 0) {
                if (dLat.equals(sLat)) {
                    feedViewHolder.layout
                            .setBackgroundResource(R.drawable.list_segment_selected);
                }
            }

            feedViewHolder.titleView.setText(title.toUpperCase());
            feedViewHolder.descView.setText(desc);
            feedViewHolder.more.setText(getString(R.string.de_list_more));
            feedViewHolder.distanceView.setText(distance);

            return convertView;
        }
</code></pre>
