In my Android app I have a TabActivity, with 3 tabs. In one of them I want to display a chart. I made the chart but I don’t know how to display in my tab. Is it possible?
I tried something like that :
spec = getTabHost().newTabSpec("tag3");
spec.setContent(R.id.details);
spec.setIndicator(lv);
spec.setIndicator("Details", getResources()
.getDrawable(R.drawable.list));
getTabHost().addTab(spec);
where lv is: lv = new LineView(this);
lv.setTitle("Budget");
lv.setAxisValueX(budget);
lv.setItems(items);
But, nothing happens. Any idea what should I do?
Create an Activity, display your Chart in the Activity and make the TabActivity launch that activity in the Tab you want.
where Chart (from Chart.class) is the Activity where the Chart is.
Hope this helps you.