I’ve being trying to display two graphics in one screen but I’m not able. Here is the code where i show one graphic inside the onClick function:
case R.id.graphs:
GraphicalView mChartView = new Niveau().execute(this);
LinearLayout layout = (LinearLayout) findViewById(R.id.graph);
layout.removeAllViews();
layout.addView(mChartView, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
break;
Any idea??
Thank you very much!
That should work. Be sure to have different ids on your
mChartView– if you create them programmatically and not inflated from an XML layout, you need to set the id programmatically too:Also, a
RelativeLayoutwould probably offer you more customization in term of layout and positionning. You then need to set the relative positions in your layout params: