Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9293301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:06:18+00:00 2026-06-18T21:06:18+00:00

All graphs in the vybrations arraylist are unique but getView is repeating the elements

  • 0

All graphs in the vybrations arraylist are unique but getView is repeating the elements for the list. I am correctly using convertView but it is still repeating the same drawings across the list. I don’t know what am I doing wrong here?

Here’s the link to what I am getting: https://www.dropbox.com/s/jlt3mr7h5vzb14q/Untitled.jpg

public class AdapterVybrations extends BaseAdapter
{
private Context context;
public ArrayList<Vybration> vybrations;


public AdapterVybrations(Activity context, ArrayList<Vybration> arrayVybrations)
{
    this.context = context;
    this.vybrations = arrayVybrations;
}


@Override
public View getView(final int position, View convertView, ViewGroup parent)
{
    View v = convertView;
    final Vybration vybe = vybrations.get(position);

    if (v == null)
    {
        LayoutInflater vi = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = vi.inflate(R.layout.vybrations_item, null);
    }

    LinearLayout layout = (LinearLayout) v.findViewById(R.id.layoutVybration);
    ImageView play = (ImageView) v.findViewById(R.id.imageViewPlay);

    final ListView lv = (ListView) parent;

    //initialize graph
    XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
    XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer();
    renderer.setDisplayValues(false);
    renderer.setZoomButtonsVisible(false);
    renderer.setShowGrid(false);
    renderer.setShowAxes(false);
    renderer.setShowLabels(false);
    renderer.setShowLegend(false);
    renderer.setPanEnabled(false);
    renderer.setZoomEnabled(false);
    renderer.setAntialiasing(true);
    renderer.setMargins(new int[] { 10, 10, 10, 10 });
    renderer.setPanEnabled(false, false);
    renderer.setYAxisMax(15);
    renderer.setXAxisMax(100);
    XYSeriesRenderer rendererSeries = new XYSeriesRenderer();
    rendererSeries.setColor(Color.GREEN);
    rendererSeries.setFillPoints(true);
    rendererSeries.setLineWidth(2);
    renderer.addSeriesRenderer(rendererSeries);

    //add data series to graph
    dataset.addSeries(vybe.getGraphSeries());
    GraphicalView graphView = ChartFactory.getTimeChartView(context, dataset, renderer, "Test");

    //add graph to linear layout
    layout.addView(graphView);

    layout.setOnTouchListener(new OnTouchListener()
    {

        @Override
        public boolean onTouch(View v, MotionEvent event)
        {
            Log.v("touched", "layout view touched");
            return true;
        }
    });

    play.setOnClickListener(new OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            vybe.play(false);
            Log.v("series", vybrations.get(position).getGraphSeriesString());
            Log.v("clickposition", position + "");
        }
    });

    if (lv.getChoiceMode() != ListView.CHOICE_MODE_NONE)
    {
        SparseBooleanArray checked = lv.getCheckedItemPositions();
        if (checked.get(position))
            v.setBackgroundColor(context.getResources().getColor(android.R.color.holo_blue_light));
        else
            v.setBackgroundColor(context.getResources().getColor(android.R.color.transparent));
    }

    return v;
}


@Override
public int getCount()
{
    return this.vybrations.size();
}


@Override
public Object getItem(int position)
{
    return this.vybrations.get(position);
}


@Override
public long getItemId(int position)
{
    return position;
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:06:20+00:00Added an answer on June 18, 2026 at 9:06 pm

    Solved: Custom ListView Items repeated.

    I did try the ViewHolder design but wasn’t removing old views. holder.linearLayout.removeAllViews() did the trick. Works perfectly now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using PHP Graph Lib PHPGraphLib i created some graphs , and all i
I have a problem with asking DBpedia about all graphs using dotNetRDF. After executing
Im using ajax to get svg graphs and django escapes all html signs...how can
I am trying to implementing plot graphs using the link. http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application But as for
I am currently doing some kind of reporting system.the figures, tables, graphs are all
All of our reports are created from object graphs that are translated from our
I have a dashboard which contains around 16 graphs. All the settings of the
I've create a Custom Object/Action/Aggregations for my app. https://graph.facebook.com/10151038251679973 All is working fine but
Is there a known algorithm or method to find all complete sub-graphs within a
All I will be doing is basic line graphs. Any experiences anyone might share

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.