I'm following the ShinobiCharts for Android quick start guide, except adding the chart fragment programmatically, like so:
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
ChartFragment chartFragment = new ChartFragment();
fragmentTransaction.add(R.id.history_container, chartFragment, "chart");
fragmentTransaction.commit();
ShinobiChart shinobiChart = chartFragment.getShinobiChart();
Everything looks to be fine until the last line, when shinobiChart
always initializes to null. I'm calling this from a custom class inheriting from Fragment
, in the onCreateView
method, and I suspect this problem might be rooted in that - but I'm not sure how to fix it.